This site uses strictly necessary cookies. More Information
X- Home /
Position in front of an object?
How can I get the position a little bit in front of an object?
positieVoor = transform.position + Vector3.forward;
Answer by Jake-L · Mar 20, 2011 at 06:34 PM
Try
positieVoor=transform.position+transform.forward
nice. Adding if you want to face the object as well // Rotate the object so it keeps looking at the target
transform.LookAt(target);
Answer by Enyph-Games · Nov 21, 2016 at 07:26 PM
You can also create an empty gameobject and position it in front of the object and then just reference that empty gameobject
Your answer
Welcome to Unity Answers
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Saving Object Position in Float NOT Object 1 Answer
Moving an object 0 Answers
Why Does My Object Change Position During Update? 0 Answers
Return object to position 3 Answers