Quantcast
Channel: Questions in topic: "follow"
Viewing all articles
Browse latest Browse all 536

An Efficient Way To Follow Transform's Position?

$
0
0
Unity Version 4.3.4, C# scripting. Barely learned Unity last year. Wish I had Pro to solve my problems. Wink wink? Hint? Hi again fellow Unity game developers. How are you? Good? Well I'm not! You see I've spent the last couple of days trying to optimize my game for IOS that lags on certain parts which screws up gameplay, but I've been having quite a hard time. So I've been making some decent progress with object pooling, eliminating empty voids, and dynamic batching, but I need help with this one thing. I have an empty game object with the script below attached to it. It follows the Player's position, and I also have a different script attached to the Player that follows the empty game object's rotation. Now I've looked up many things on how to optimize the scripts so that they won't make my game's frame drops worse, but alas I could not find anything that helped me. I've read about caching but I could not get it to work because I'm a little stupid(I admit it). So I ask of anyone to please help me find an efficient way for this script! I know this and other scripts similar to this are part of the last remaining things that drop my frames. So please if anyone could help, help! public Transform track; // Update is called once per frame void Update () { if (track) transform.position = track.position; } } Other script on Player: public Transform track; // Update is called once per frame void Update () { transform.rotation = track.rotation; } }

Viewing all articles
Browse latest Browse all 536

Trending Articles



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