- Home /
Vector3.SmoothDamp has some invalid arguments
I have a set of code like so:
using UnityEngine;
using System.Collections;
public class SkyboxCamera : MonoBehaviour {
public Transform otherCamera;
public bool damp = false;
public float smoothTime = 2.0f;
public Vector3 velocity = Vector3.zero;
void FixedUpdate () {
otherCamera = Camera.main.transform;
if (!damp) {
transform.rotation = otherCamera.rotation;
} else if (damp) {
transform.rotation = Vector3.SmoothDamp(transform.rotation, otherCamera.rotation, ref velocity, smoothTime);
}
}
}
For some reason every time I'm getting a error where the Vector3.SmoothDamp is at that says:
The best overloaded method match for `UnityEngine.Vector3.SmoothDamp(UnityEngine.Vector3, UnityEngine.Vector3, ref UnityEngine.Vector3, float)' has some invalid arguments
What am I doing wrong? Im following the documentation for Vector3.SmoothDamp and everything looks fine to me. Am I missing something?
transform.rotation is a Quaternion, not a Vector3. Try Quaternion.RotateTowards() or Quaternion.Slerp() for what I think you want to do here.
Your answer
Follow this Question
Related Questions
Help with AI script 1 Answer
Unknown reason for NullReferenceException error 1 Answer
Instantiate object in C# 1 Answer
Vector3 multiplied by its magnitude results in infinity? 1 Answer