- Home /
How to make proper yaw effects in 3D space exploration game?
I am trying to write a movement script to move the universe around the player, and to yaw I rotate the player game object. This becomes an issue when the player tries to move forward and it just moves straight. I was wondering if there is a formula for calculating the amount of forward force and sideways force needed, depending on the rotation?
Sorry if my explination is hard to understand, I am very new to this!
When you say it just moves straight what do you mean? $$anonymous$$ore specifically, how are you applying the forces? Via Rigidbody AddForce?
There shouldn't be any need to calculate this, assu$$anonymous$$g you are applying the force in the proper direction (e.g. transform.forward for thrust) - and applying Torque force to rotate.
im using addforce, If i use transform.forward it will wnconter the same problem as i have still rotated the object and not the universe.
O$$anonymous$$ - so the part that I'm not sure about is why you want to rotate the universe? Everything is relative, so you can either rotate a universe around an object, or rotate the object within the universe :)
The latter is easier.
And if by universe, you mean all the other objects in the world, then definitely this wouldn't be a good performance model.
If you attach your camera to the your player object, and rotate your object, the universe "rotates" around you - as the camera is applying a matrix calculation and projecting to 2D (the screen). As above, move your camera, or keep your camera still and move the universe. The second one doesn't make sense...
I guess I don't really understand the effect you are after. You may need to write up more detail on what you are trying to achieve.
Ian.
Answer by w212ds · Jul 27, 2015 at 04:48 AM
You could make it to play a animation when pressing the "Yaw" keys/input. Were the animation plays and your object rotates?