will "call attribue" solve this?

QbAnYtOQbAnYtO Member Posts: 523
edited November -1 in Working with GS (Mac)
basically i want my bullet to cause a "screenshake" effect when it hits another actor.
because i can't use prototypes to control the camera i made a attribute called "shake" and an invisible unlocked actor in the scene (remember this).

then i have on the bullet:

*********************************
when bullet collides with enemies
change attribute "shake" to 1
*********************************

then in that unlocked invisible actor on scene i have these behaviors in it:

*********************************
when attribute "shake" is 1
[
TIMER for 0.5 seconds
-(inside timer) every 0.1 second "camera.origin x-10... (etc etc u get it. the shake effect)
]
After 0.5 seconds
change attribute "shake" to 0
*********************************

ok, so when i shoot to enemies it DOES shake for a few shots. but then it stops working . the shake effect can no longer be reproduced. usually after a few shots. its weird huh? am i doing something wrong?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    A good way to debug this is move your actor into scene and put a display text and assign it to display your shake attribute. then you can see if its reseting itself etc. It looks like your rule should work so theres prob just an attribute not setting back the way it should and it the shake attribute is working right you know you can start look at other issues that affect the same rule
  • QbAnYtOQbAnYtO Member Posts: 523
    funny thing is i have been doing the "display text" thing for my other stuff like bullet amount and reloads. i guess it wouldnt hurt. i'ma try it out BRB!
  • QbAnYtOQbAnYtO Member Posts: 523
    well it stays in "1" it SHOULD be changing back to "0". hmm....
  • QbAnYtOQbAnYtO Member Posts: 523
    damn i don't get it... it stays on "0" even after the collision. this is so weird.
  • QbAnYtOQbAnYtO Member Posts: 523
    hmm... i think i fixed it.

    i added the collisions behavior to the enemies instead of the bullet since the bullet destroys on collisions....prolly throwing off the whole formula
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Yes destroying the actor before an "after" timer triggers I believe will mess it up. When you do stuff like that I think you actually use two timers

    For .5 sec
    --After .5 sec
    ---Change Attribute to 0

    etc.
  • QbAnYtOQbAnYtO Member Posts: 523
    now the explsion animation wont animation on collisions lmao!!!!

    oh man its fun learning!
Sign In or Register to comment.