Hi
Typically, the fsm that detect this trigger should send an event to the target that was hit by this raycast ( your ennemy), and that's how your ennemy is going to know it's been hit.
Does that make sense?
bye,
Jean
Makes sense, I'm just a little lost on how to set up the variables. I decided to change my gun to shoot an actual bullet object instead of ray-casting the hit (makes the game look cooler and run a little smoother) but I'm still confused on how to make my enemy recognize the hit.
I currently have 4 enemy types in my game and each of them will have an "enemy" tag and layer. All of the enemy's will be in their own prefab and spawn at random locations.
Again I'm a Playmaker newbie (but its surely easier than regular scripting) so I'm not quite sure how to set this up in Playmaker:
-Bullet FSM-
State 1:(currently have) Add force to shoot the bullet. (though there may be an issue with this because sometimes my player movement will be effected by the bullet launch).
-(currently have) Collision Event
State 2: (need) Bullet to detect if it has collided with an object that has an "enemy" tag.
State 3: (need) If the bullet has hit an enemy it should then send some event and the enemy will loose HP.
State 4(or 3): (currently have) bullet explodes and "destroys self".
My enemy (so far) is set up like this:
-Enemy FSM-
State 1: Float compare (using "health" variable)
State 2: Float subtract (subtracts health then loops back to State 1)
State 3: Upon death (float compare sees equal or less than 0) Create game object (explosion)
State 4: Destroy self
I've been playing around with both the enemy FSM and bullet FSM and I can't seem to get them to send a message. I'd greatly appreciate it if someone could tell me what actions to use and how to set up the variables / events.
At this point I'm not sure if the problem is my enemy or the bullet. I'd also like to know how to set up how much damage my bullet does.