- Home /
Question by
dragonking300 · Jan 24, 2017 at 06:59 PM ·
c#scripting problembeginner
How do I make my joint slerp from 1 rotation to another?
I am stuck trying to get my axis to rotate to a certain point but I am stuck because Transform doesn't contain the definition for slerp and I can't change my transform to quaternion because quaternion doesn't contain the definition for rotate ;-;
using UnityEngine;
using System.Collections;
public class physics : MonoBehaviour {
public Transform StartingPosition;
public Transform Target;
void Start()
{
transform.rotation = Quaternion.AngleAxis(90, Vector3.down);
Target.rotation = transform.rotation;
Target.rotation = Quaternion.AngleAxis(180, Vector3.up);
}
// Update is called once per frame
void Update ()
{
transform.rotation = Quaternion.Slerp(StartingPosition, Target, Time.deltaTime);
}
}
Comment
Answer by dragonking300 · Jan 25, 2017 at 09:55 PM
bump a dee bump a doo, I will bump this this post so it sees you