- Home /
Movement cutting frames in half?
I'm experiencing some bizarre and massive frame loss when moving my character. The weird thing is, this frame loss only occurs when the character is moving either forward or backward. My first thought was that the animation for walking was more intense than the animation for turning, so I changed them both to be the same. Frame rate is still getting cut in half. I thought it might have to do with the camera following the character and having to draw new terrain and objects. However, rotation still causes new objects to be drawn, and the frame loss is normal when rotating. Additionally, I created multiple versions of my character prefab in the scene, but only attached the camera to one of them. They all respond to the input the same way, and this causes frame rate to be cut in half for each character copy, down to a ridiculously low number considering I've only got about 10 low poly objects in my scene.
Our movement code is a carbon copy of the 3rd Person Controller script, except with all the jumping mechanics removed.
We use the Input.GetAxis() function to recieve movement input. It only experiences massive frame loss when Input.GetAxis("Vertical") is receiving information. This leads me to my final conclusion. The W and S keys are computationally more expensive than other keys. Lol, this is not a satisfactory conclusion.
Anyone have a better idea of what's going on?
Turns out the framerate loss was due to the constant collision checking with the terrain, which was comprised of WAY too many Tri's. We replaced the terrain with a two-tri plane and the problem was resolved.
Answer by Velketor · Mar 30, 2011 at 10:46 PM
try bringing your frame-rate-consuming character into a different Unity scene and see if it happens still. that will help you troubleshoot the issue.
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
Can we control a character's joints? 1 Answer
Accurate Frames Per Second Count 5 Answers
Bad fps on blank project android,Very bad fps on completely blank project (mobile) 0 Answers
Is FPS independency possible when testing in the editor?? 0 Answers