0
votes
1answer
74 views

How do I make an object's y-axis align with a Vector3?

I have a golf ball on the ground, and from a raycast, I have the normal which gives me the slope of the ground by the ball. I have an object which is rendered on the HUD to show that slope to the ...
0
votes
6answers
223 views

Quaternion Lerp never reaches target

I seem to have misunderstood something about how LERP works. Im not sure what is missing. The object is rotating as it should, but it cant seem to get it to end. The transform.rotation dont seem to ...
0
votes
2answers
112 views

Rotate GameObject on click

I'm trying to get a card to flip when clicked but the flipping only works the first flip. While debugging, I can see that OnMouse is called every time I click. public class CardController : ...
1
vote
1answer
152 views

Making player movement direction follow players facing direction

if (controller.isGrounded) { moveDirection = new Vector3 (Input.GetAxis ("Horizontal"), 0, Input.GetAxis ("Vertical")); moveDirection = ...
7
votes
3answers
337 views

Slerping rotation mirrors

I rotate my game character to watch at the target using the following code: transform.rotation = Quaternion.Slerp(startQuaternion, lookQuaternion, turningNormalizer*turningSpeed/10f) ...
0
votes
1answer
216 views

Mouse Aiming Causing Rotation Jitter

When our game's ships move around, mouse aiming causes them to shake around a lot. The body being aimed is moved kinematically. I think we've narrowed it down to this block of mouse tracking code. ...
4
votes
1answer
442 views

Why game engines usually don't offer a vector3.rotate method? [closed]

Game engines like Three.js, Ogre3d and Unity3d often don't provide a default rotate method on their vector class. You usually have to do something like: rotated = vector.applyQuaternion( new ...
1
vote
1answer
367 views

How to get a point to the left/right of a vector

I have a position vector of a point in space and a quaternion for it's rotation. What i'm trying to calculate is a point too the left and a point to the right. I have the position and ...