Collision and visibility state help?

Game Editor comments and discussion.

Collision and visibility state help?

Postby DragooNz » Wed Dec 10, 2014 2:11 am

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..
DragooNz
 
Posts: 6
Joined: Sun Sep 01, 2013 5:33 pm
Score: 0 Give a positive score

Re: Collision and visibility state help?

Postby gamemakerdude » Wed Dec 10, 2014 6:25 am

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!
User avatar
gamemakerdude
 
Posts: 72
Joined: Thu Sep 13, 2012 4:12 pm
Location: Texas
Score: 7 Give a positive score

Re: Collision and visibility state help?

Postby DragooNz » Fri Dec 12, 2014 2:04 am

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?
Attachments
visibility.rar
(4.5 KiB) Downloaded 130 times
DragooNz
 
Posts: 6
Joined: Sun Sep 01, 2013 5:33 pm
Score: 0 Give a positive score

Re: Collision and visibility state help?

Postby DjVan » Fri Dec 12, 2014 6:53 am

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);
2.B.A
User avatar
DjVan
 
Posts: 24
Joined: Fri May 23, 2014 4:09 pm
Location: Pallet town
Score: 3 Give a positive score

Re: Collision and visibility state help?

Postby DragooNz » Sat Dec 13, 2014 2:03 am

great! it's work. thanks anyway guys! :D :D
DragooNz
 
Posts: 6
Joined: Sun Sep 01, 2013 5:33 pm
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest