- Home /
How to make a script that imitates the parent-child transform lock ?
As many of you know when you have an object being a child of another, this object becomes "locked" to a certain "position"(transform) of the parent object, is there any way to imitate this effect with a script ?
i am trying to make a 3D space game so this have to work in all axis (of rotation and position), my idea is to use this locked transform in the camera for a better maneuvering, but with the option of when pressing a defined keyboard key being able to make the camera orbit around the ship (even when in movement).
Answer by Paulius-Liekis · Aug 17, 2015 at 10:59 AM
Are you talking about this:
childGameObject.transform.parent = parentGameObject.transform;
i dont know, to use this do you need to turn a object into a child of another ?
if that's the case then no, i think my description makes clear that i need the liberty of orbiting the ship (player).
Your answer
Follow this Question
Related Questions
Place a object in front the camera in the coordinate 0 of Y axis 2 Answers
"Lerp" back to original position after animation. 0 Answers
Move JoyStick Together With Camera 1 Answer
Script incompatible with unity 5.3. Please Help! 1 Answer
Make OnMouseButtonDown do whole task and not just when pressed 1 Answer