For the sake of the question, imagine a character that is going to instantiate a bullet that will travel…
So, let’s say I want the bullet to travel whatever direction the character is facing, what is the best way to do this? I know how to instantiate and have the projectile travel in a specific direction using transform.translate, but what method is used to detect which direction the character is facing?
parents transform.forward
ok awesome I got that working in a simple 3d scene, thank you. What if I was trying to do this with a 2d platformer type of controller. Would I have to set up the scene so that my horizontal was Z? So instead of the traditional X and Y, would it have to be Z and Y?
EDIT: I mean 2.5D. I would be using 3D objects but only using them as a sidescroller, is what I meant.
transform.right to go right, transform.right * -1 or -transform.right to go left.
so in that case would you have to build an if statement that knows which way to send the bullet based on which direction the character is facing? How would that work?