Performance questions - again :)

Hi,

I spend the last days searching for new optimization methodes. Now I have a few Ideas and questions about optimizing (iphone projects) - maybe soeone of you has experience with the following things and could share some hints :).

1.“simply animations” - for example i would like to rotate a object (let me say a coin in a j&r game) I could do this in 2 ways:
first I use the animation timeline and I set 2-3 nodes with rotation and the animation parameters on loop = the coin will rotate.
second I write a script like this:

	Transform myTransform;

	public Vector3 rotationSpeed = Vector3.zero;
	
	void Start() 
	{
		myTransform = this.transform;
	}
	
	void Update()
	{
		myTransform.Rotate(rotationSpeed * Time.deltaTime, Space.Self);	
	}

the question is - what is better? using one “update call” or the timeline :slight_smile:

  1. the scripts are not as fast as native code (even if they are compiled into some sort of native code)… anyway I had the idea(but no objective C skill to test it :frowning: ) - to write some code in o.C and then calling it from the scripts. for example - “swarms” in a game - at 20 moving units the iphone simply dies :slight_smile: (because of the scripts not graphics) the thing is what about doing such a thing: the objective C code handels the movement,collision and so on - and returns simply a list of transforms (or only positions) for my units?

  2. physics… how does unity handels physic optimizations? it is better to have one big level mesh for the collision or a lot short collision meshes, where I can turn on/off the collision for distant places?

that is all at this moment :slight_smile:

with best regrads

Sim

Anyone?
You could be sure if I could, I would check this out myself :slight_smile:

You couldn’t control the transforms from outside of Unity (the only place you can use Obj-C), and doing so would be slower than Unity can natively do it anyway.

Perhaps if you move all 20 objects from a single update loop, rather than moving 20 from 20 individual loops, you would find performance is no longer an issue.

Basic transforms shouldn’t really be that slow anyway, its usually physics etc that will cripple the device.

Ok thanks!
And Can you say something about the first question - you know simply “code” animations or ani files?