- Home /
Question by
Guynelk · Jun 18, 2017 at 04:53 PM ·
c#camerascripting problemscripting beginnerfollow player
"Follow Target" script with a prefab (C#) Help me please!
I want to follow target a prefab but I don't arrive to do that. The script:
using System; using UnityEngine;
namespace UnityStandardAssets.Utility { public class FollowTarget : MonoBehaviour { public Transform target; public Vector3 offset = new Vector3(0f, 7.5f, 0f);
private void LateUpdate()
{
transform.position = target.position + offset;
}
}
}
Comment
Answer by JxWolfe · Jun 18, 2017 at 07:57 PM
You can use unity's built in Navigation if your prefab is on the ground. Navigation in the Manual
Your answer
Follow this Question
Related Questions
Rotatearaound a moving object 1 Answer
One of the functions on my Camera script doesn't execute correctly. 1 Answer
help with enemy health script 2 Answers
GameObject detect LineRenderer colliding? 2 Answers
Unity Editor Freezes- Help! Urgent! 1 Answer