Alright, I'm not sure why you're using two timers in your first behavior. The way you have it, you're waiting for every Shoot seconds, then waiting again for Delay? seconds. If that's on purpose, fine, but it looks weird.
Oh, I have it set like that so I can control each cannon in the scene editor differently. So one cannons shoots every 2 seconds, and the next cannon shoots every 2 second but only after 1 second. So they shoot back and forth.
In your "always" loop, you should only change the animation if it's necessary, so
if (Fired? == True and Animation For Self != Fired) {
Switch animation to Fired for self;
}
if (Fired? = False and Animation For Self != Idle) {
Switch animation to Idle for self;
}
It's actually working how I have it now. The cannon is in idle, and when it fires it switches to it's fired animation, and then after 1 second (I changed it to 0.25), it switches back to idle.
In the pressure plate behavior, you are using "self" in the "get" blocks. So, you are getting _UniqueID and _IsActive from the Actor the behavior is attached to, which I assume is a pressure plate. You need to use "Actor of Type" where you have Self. That way, as you cycle through all the Actors of type "Down Cannon," you are checking the current Down Cannon for the values.
Sorry, I don't fully understand. I didn't realize I could drag the "Actor of Type" thingy down and into the "get" blocks. Is that what I'm supposed to do? XD
You never use the Cannon List, instead you are checking "_UniqueID" against the value "Yes." Let me explain Cannon List.
Cannon list should be a list, with values like this:
0
2
3
5
Then, you check each Down Cannon's _UniqueID against each item in Cannon List. That way, one pressure plate can control multiple Down Cannons. So, your loop should look like this:
For each Actor of Type Down Cannon {
For each item in Cannon List {
If (for [actor of type], get [_UniqueID] from behavior [Cannon Fire] == item from Cannon List) {
Do stuff;
}
}
}
Again, sorry. This is the first time I've ever used a list so I don't fully understand. For "item from Cannon List", do I just type in the number or text in the list that I'm looking for, or is there a block I need to pull out? In the list I added values "Yes" and "No" and then in the Unique ID's for the cannons I wanted the plate to control I put in Yes, and for the ones I don't want it to control I put in No.
Finally, you never set IsActive? back to true, so once the pressure plate is stepped on, the Down Cannon will always be off. At the end of the "always" loop in your Cannon Fire behavior, set "IsActive?" back to True. That way, the Cannon starts each frame with IsActive? being True, and it only gets turned off if the player is still on the pressure plate.
I did that because I didn't want the cannons to come back on.
Thanks again, you're awesome!