Here is the profiler info for my project: http://postimage.org/image/6kslmj0b9/
I did Deep Profile. Do you guys see something wrong? For example I was surprised that RigidBody.get_position() costs that much, look at that 12.6 %
Thanks
Here is the profiler info for my project: http://postimage.org/image/6kslmj0b9/
I did Deep Profile. Do you guys see something wrong? For example I was surprised that RigidBody.get_position() costs that much, look at that 12.6 %
Thanks
Yeah properties in combination with value types are heavy when used very often (like the 45000 calls you have).
First a method call (get_position) then the construction of the return type (the vector I suppose). I dont know if get_position does more inside the method itself, when it does nothing more than just returning the position the chance that everything will get inlined in a normal environment are great.
Any way to go around this?
This depends…
When you pick the position multiple times in one work step from the same Rigidbody you could store the position somehow/somewhere.
What exactly does get_position (Could you foldout the method in the profiler?)?
And how do you use the result, could you provide a code sample from you?