Quantcast
Channel: Questions in topic: "parenting"
Viewing all articles
Browse latest Browse all 302

parent and set localpositions and rotation from gameobjects to a specific local location

$
0
0
I have a player(Tiger) and enemies, other animals. What i want to do is when the player kills the enemy that he can grab the enemies neck in his mouth and drag him with him. So the localposition of the animals neck should be set to the players mouth localposition. What i've done is first make the animal a child of the players mouth, and then set the animal position same as the animals neck localposition. but the pivot of the animal is at the legs... so i have no idea how to do this. Enemy1.SetParent(DragMouth.transform); Enemy1.gameObject.transform.position = Enemy1.GetComponentInChildren().transform.TransformPoint(0, 0, 0); Enemy1.localRotation = Quaternion.identity;

Viewing all articles
Browse latest Browse all 302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>