- Home /
Shooting with variable vector3
Hlo everyone. I am currently working on a game where my character has got loads of stuff on him. Like smoke, health bar and stuff. I was working on a shooting mechanism where I work with instantiated bullets. I translate the bullets in the forward direction. But because the character has got so many stuff on him, his vector3 position and vector3 rotation never remain constant. Eg : initially when all the character is at one place, the vector3 position is right at the middle of the character. But when I move the character ahead, the particles remain behind, which changes the overall vector3 position and rotation. In this condition, when I instantiate the bullet it never goes ahead! Because of incorrect roration on the character, the bullets move here and there. While translating I used both vector3.forward and transform.forward but neither seem to work. Could someone pls help?
Could you post some code? How are you spawning bullets? How are you moving them?
As Habitablaba said, we need to see some code.. Because it can be just the slightest little thing and you're stuff be all ruined.. But it's sounding like you're using the wrong type of Rotation as you said....
I forgot what it's called off the top of my head, but look up on Google and stuff how to rotate character in world space not local.....
Or just make sure you have all your stuff attached to player properly.
But until we see code that's all I can say for now.
Hope that helped :)