Page 1 of 1
Collision and visibility state help?
Posted:
Wed Dec 10, 2014 2:11 am
by DragooNz
Can anyone help me how to make an actor invicible when another actor touch it? and back to solid when it doesn't collide?
i have try using collision > changetransparency and collision finish > change transparency, but the actor keep blinking (transparency keep changing)
I'm sorry if i post in wrong place..
thanks anyway..
Re: Collision and visibility state help?
Posted:
Wed Dec 10, 2014 6:25 am
by gamemakerdude
Easy! All you have to do is create a Collision Event in the actor control panel of the actor you want to be invisible, then add a Script Editor action set to collide on any side of the other actor you want it to react to, and in the script editor call the Visibility State function to react to the event actor and its state to Disable. To undo this and make the actor appear visable again, create a Collision Finish event in the actor control panel, add a Script Editor action to react to the appropriate actor in collision. In the script editor, call another Visibility State function and this time, set its state to Enable. Et Voila!
Re: Collision and visibility state help?
Posted:
Fri Dec 12, 2014 2:04 am
by DragooNz
well, it didn't work, here i attach an example.
left character control are 'a' and 'd'
right character control are arrow_left and arrow_right
or, did i made a mistake?
Re: Collision and visibility state help?
Posted:
Fri Dec 12, 2014 6:53 am
by DjVan
just a simple mistake
if visibility state were disabled no collision will occur and ge will execute the collision finish action (which is to enable Visibility State and another collision will happen) loop..
so in collision you should make it don't draw but allow events(collision even when it's invisible)
- Code: Select all
VisibilityState("Event Actor", DONT_DRAW_ONLY);
Re: Collision and visibility state help?
Posted:
Sat Dec 13, 2014 2:03 am
by DragooNz
great! it's work. thanks anyway guys!