Problem with projectile rotation - 2D
I am creating a 2D game with a character who can shoot fireball projectiles from his fist. The projectile is a particle system parented to a gameobject. The fist rotates to face the cursor, and ideally, the projectile would fly in the direction of the cursor when spawned. The projectile has a script that makes it fly upwards, and the angle can be adjusted. When I put in the rotation value of the fist the projectile always flies in a different direction, except for when the fist is pointed upward at 0 degrees. I worked out through testing that, for whatever reason, the projectile has half of the rotation value of the fist at all times - for example, if the fist is pointed down it has a z rotation value of 180, but the projectile flies down when given a value of 90. I initially thought that this issue could be solved by giving the script
Quaternion.Euler(0f, 0f, fist.transform.rotation.z / 2)
for the rotation value, but when I try to multiply or divide the arguments the projectile just flies up.
I'm sorry if that was hard to follow. I would really appreciate it if you could give me any ideas.
Your answer
Follow this Question
Related Questions
Set Instanatiated Object's Rotation Towards Player 1 Answer
Using quaternions in 2D to follow a rotation. Both question and an Answer. 0 Answers
Getting a 2D object to face the direction of its velocity relative to other objects in the level 0 Answers
Rotation issue when selecting a new waypoint. 0 Answers
Lock Rotation of Object between 2 points, which is looking at the direction the mouse is pointing 1 Answer