Quantcast
Channel: Latest Questions by Crispinator
Viewing all articles
Browse latest Browse all 30

Adjusting Rotation of Instantiated Objects

$
0
0
I have a sword in a game. When you click on the sword, it deletes and creates another one in your hand. It does this correctly but with a random rotation. How do I fix this? #pragma strict var hand : GameObject; var sword : Transform; function OnMouseUp() { Destroy(gameObject); var clone = Instantiate(sword, hand.transform.position, Quaternion.identity); clone.transform.parent = hand.transform; Debug.Log("The Sword is in your Inventory"); WaitForSeconds(1); }

Viewing all articles
Browse latest Browse all 30

Trending Articles



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