Fade Actor In and Out Every 3 Seconds

JoshKahaneJoshKahane Member Posts: 470
edited November -1 in Working with GS (Mac)
Hi

So its me back again for more help. :)

I want my actor to fade in and out every 3 seconds, and when faded out my other actor can't collide with it so it can pass it. So essentially in game you have 3 second time periods to get through this gap in the puzzle.

Yet again I have gotten myself into a muddle, any help would be much appreciated as per usual, thanks.

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    one solution would be to create an attribute called collidable. On your object, create a timer:
    Every 3 seconds
    change attribute game.collidable to (game.collidable+1)%2

    Every three seconds this will switch that attribute from 0 to 1 to 0 to 1 and so on.

    Then on your player (or whatever it is) add a rule that says
    if attribute game.collidable = 1
    colide with player actor
  • JoshKahaneJoshKahane Member Posts: 470
    Hmm, nope doesn't work. At least the alpha isn't changing on the fading actor, wether the colliding thing works as well I can't tell. Tried adding change attribute, self.alpha but im not doing something right. I hate how bad at this I am (Im not very logical), haha.
  • JoshKahaneJoshKahane Member Posts: 470
    Thats worked great, thanks tshirtbooith (yet again) and Mulcahy.

    My issue now is that I want it so that when the actor has an alpha of 0 I can pass through without changing to my game over scene and when the alpha is 1 it can cause game over when colliding.

    Back soon, getting dessert! I need some brain power and its getting late here in the UK. :)
  • JoshKahaneJoshKahane Member Posts: 470
    Yep, just got it, thanks again. Also, thank you home made carrot cake! Hehe, kicked my brain into action.
Sign In or Register to comment.