Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on September 30, 2013, 07:25:43 PM
-
Hi!
I have a bullet going slowly horizontally over the screen. When the bullet passing the X-position of the Player, I want it to shoot at the Player.
What is the best way to do this? Can I use Raycast for this? I have never used Raycast, so I need some help with that.
I was also thinking I could have a sensor or something which is attached to the player, and when the bullet hits that sensor, it will shoot against the player.
-
Hi,
You should use triggers for this. Have you used triggers before?
bye,
Jean
-
Yes, I have used triggers before, but how should I set it up? I tried to have a long bulletdetector checking the bullet horizontal and vertical. And this bulletdetector is following the player. It's working in a way. But what would you do? Should the FSM actions be on the bullet or the bulletdetector?
-
How can I get the bullet to shoot against the player? Depends if the player is below or above the bullet. And I want it to shoot straight against the player, not following it.
-
Hi,
can you make a quick drawing? I am not sure I follow.
re triggers, you put the action where it makes more sense for you, the bullet could be checking for the trigger and self destroy and applay damage, or the player could check for buller and then destroy the bullet and apply damage to self. Generally, I would suggest that the bullet implements the logic.
bye,
Jean
-
Hi!
You can take a look by yourself!
The only problem I have as you can see of this example, is that the bullet is shooting against the player, but only when i'm below the bullet. I know why! Because the bullet is set to shoot down. Not directly against the player as a target, if you know what I mean! I don't know how I can shoot at the direction of the player. So I need help with that.
It's better you take a look at it, instead of that I try to explain :-)
-
Finally, I made it all alone! So now it's working! :D
I'm very proud of myself now. And very tired in my brain! :-)
I can upload the end result!
-
Here is the working file!
I'm sure it's more than one way to do this, but as long as it's working, I'm happy!:-)
-
Hi,
congrats! there is nothing better than a tired brain, that's how you'll learn and gain true expertize! :)
Bye,
Jean