Constraining attributes for a following actor
skippy
Member Posts: 106
If there is a fish tank on the screen and a fish inside the tank and the constraining attributes keep the fish in the tank, when the tank gets destroyed why does the fish stays where the tank was destroyed where as i want the fish to fall down, iv'e tried different combinations like move, change velocity, accelerate but everything i try the fish remains where the tank was destroyed, are the constraining attributes keeping the fish there ? can i disable them when the fish tank is destroyed to make the fish fall downwards ?
I did this for the following actor "the fish" when the main actor is destroyed :
create rule, attribute game.lifebar = 0
destroy this actor (which works)
but nothing else will to make the fish fall instead of destroy
I did this for the following actor "the fish" when the main actor is destroyed :
create rule, attribute game.lifebar = 0
destroy this actor (which works)
but nothing else will to make the fish fall instead of destroy
Comments
Wrap your Constrain Attributes for the fish in a Rule, like this:
Rule
When game. FishTankIsDestroyed = FALSE
Constrain Attributes
Otherwise
Accelerate Direction:270, Speed: whatever
When the tank gets destroyed, set game. FishTankIsDestroyed to TRUE
game.boolean - Fish Tank Destroyed
In your fish actor:
When Fish Tank Destroyed = False
Constrain blah blah
else: acceleration spd 1200 (play with it) direction 270
In your Tank actor:
Wherever you have your destroy rule also put a rule to change game.Fish Tank Destroyed = True
Hope this helps
JGary
EDIT: FMG - GRRRRRRRRRRRR
why not just create the fishtank as a set of two invisible walls, a floor and a ceiling the fish will bounce back and forth inside the container. when the fishtank is destroyed, the invisible walls will vanish, and the fish will fall to the floor. no code needed.