- Home /
Question by
Super Flat · Aug 16, 2012 at 04:08 PM ·
rotationrotatespheresteeringunitysteer
UnitySteer - Steering around an sphere
I'm using the following to make objects navigate around a sphere, I've implemented my own crude collision detection but it's not at all ideal for the types of behavior i would like. So i've decided i wanted to try and implement UnitySteer.
public void Update()
{
transform.position += transform.forward * Time.deltaTime * ForwardSpeed;
Vector3 surfaceUp = transform.position - Vector3.zero;
Quaternion surfaceUpRotation = transform.rotation;
surfaceUpRotation.SetLookRotation(surfaceUp, -transform.forward);
surfaceUpRotation *= Quaternion.Euler(90,0,0);
transform.rotation = surfaceUpRotation;
}
The above is the code i use to have objects navigate around the sphere. How can I use this correctly in UnitySteer and have it avoid terrain correctly?
Comment
Your answer
Follow this Question
Related Questions
Make sphere rotate when controlled 7 Answers
Quick Shortcuts for Rotation 0 Answers
Object rotates with camera 2 Answers
Rolling sphere keep velocity but slow rotation 1 Answer
Why the player is not rotating and moving at the same time ? 0 Answers