i am trying to get something to animate only when a ball is shot would i use a timer or attribute?
macman123
Member Posts: 98
i'm working on my second game ever. And i am trying to get the plant as shown below to animate, but only when a ball is shot from it. how would i proceed to do that?
Answers
this what i want it to do.
for some reason thee picture is not posting sorry.
You have to zip any files before uploading
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
http://gsanimator.com/product/a-plant-animation/
this is the link for the picture and how i wat it to animate
Create a Boolean that says Animate Plant
Than create two rules
Rule 1
The first rule is when Ball is shot
change Attribute Animate Plant to true
Rule 2
The second Rule is When Animate Plant is true
Animate Plant
Than change Animate to False in this same Rule so that it doesn't keep animating.
@colander i was trying to send the link to the animated pic of what i wanted from a url. thanks though
@scuurpro thanks i'll try that.
Use a game level boolean attribute and set it to true in the actor with the event that fires the ball. In you plant actor have a rule If boolean attribute = true run the animation once and reset the boolean attribute back to false.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
@scuurpro so when ball is shot should the that be an attribute too?
@colander im not understanding that totally. do you want me to put the attribute in the plant?
or have 2 attributes.
oh ok thanks. where is it?
oh i see it
@scuurpro thanks for the template. i understand now.
A game level boolean attribute is just a switch to turn something on or off. You can also use an integer and use 0 as off and 1 as on. I prefer integers because later on I may want to change it and add more conditions i.e. 0 is off 1 do this 2 do that, etc.
What actor triggers you plant actor to fire? Whatever it is lets say a button actor, put the attribute in a rule "When button is pressed" and change its value to true. Then in the Plant actor create a rule "Attribute game.bWhateverNameYouLike = true (Or 1 if you are using and integer)" run the animation and then reset your attribute back to false or 0.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
what triggers the plant is a timer cause i wanted him to shoot by himself at first but i changed my mind. so now its click.