How To Make An Object Appear In Front Of Player Without Cloning?
How do you make a C# script where a public gameObject is placed in front of a player (also public gameObject) without cloning it?
What I got so far:
Instantiate (Block, Player.transform.position + (Player.transform.forward * 2), Player.transform.rotation);
I want the code above but without cloning it.
Please help.
Thanks in advance! :)
Answer by Bilelmnasser · Oct 02, 2017 at 10:25 AM
hi , simply set your block position and rotation like you have already done :
Transform block;
block.position=Player.transform.position+(Player.transform.forward * 2);
block.rotation = Player.transform.rotation;
this will set position without cloning :D
Your answer
Follow this Question
Related Questions
How to find the transform position of another gameobject then move a gameobject to that position? 1 Answer
Preventing A Teleporting GameObject From Passing Through Walls 2 Answers
How To Make A Character Stop At A Block? 0 Answers
Make object move back and forth 2 Answers
i need to change box position in y axis if i hit from down (c# script) 2d 1 Answer