Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

How To Make An Object Stay Somewhere Relative To Another Object

$
0
0
This may have already been discussed, but here we go anyway. I have this code right here: #pragma strict public var target : Transform; function Update () { transform.rotation.x = target.rotation.x; transform.rotation.y = target.rotation.y; transform.rotation.z = target.rotation.z; transform.position = target.position + target.position(-3,-1,0); } This code rotates it properly, but it just stays in place, instead of following a point on "target". BTW, "it" is the object the script belongs to, and the "target" is an object that rotates a bunch. If you could help, it would much be appreciated. Thanks, Fahim,

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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