- Home /
Hi all. I am new to unity. And the problem is with the FPS of my scene.
My scene includes a plane made in unity. A cow made in maya. 4 Hills made in maya.
I want to move my cow by A* algo. I have downloaded the A* algo from here http://arongranberg.com/astar/docs/getstarted.php . The Algo works fine for cube and cylinders but if i attach it to my cow my FPS goes low approx 2 to 3.
In the above A* there is a option Next Waypoint Distance if i set it 3, the cow doesn't move but FPS is 250 to 450. And if i set Next Waypoint Distance to 5 or above, the cow doesn't move and FPS goes down to 2 to 4. Don't know why please help.
I have attached the screenshots.
Thanks in advance. And Sorry for my English.
Try something like, parenting a invible cube with the same size of your cow, and at the same place, attach the script to this cube and try, it's a way that I found to solve this '-'
Answer by seckincengiz · Jan 07, 2014 at 02:02 PM
Hi Priyanshi, I think your maya model mesh is too complex. Try to mark your mesh collider as Convex. If it won't work then try making your own colliders.
Mesh Colliders very expensive for pathfinding algoritims. You can make your own colliders by putting box colliders to your cow model. To do this: first, create empty game object and add collider component to it. (Add Component/Physics/Box Collider) You can add few box collider depending on your model's shape.) then position it on your model. Your custom colliders should be parent your model. Then deactive mesh collider in inspector.
Thank you for your answer. But i tried and it doesnot work. I have made a box collider and its a parent of my cow. And now cow is falling down. I think i am missing something. :(
Try these;
Delete rigidbody
$$anonymous$$ake sure cow's mesh collider is deactiveted
Deactive your animation. $$anonymous$$aybe problem is animation related.
deleted rigidbody, animation and mesh collider is deactivated. Still its falling down. But Problem of FPS is solved i think. i have activated the A* algo and still the FPS is 300. But not Sure till the everything goes well. I have attcahed the screenshot.
You said " I have made a box collider and its a parent of my cow.". I can see that your box collider has all the scripts. Therefore box collider should be positioned in right direction. You should rotate it 180 degree in y axis i guess. Because your control scripts tell your box collider move along the z axis or something else. If these wont work you can try your codes on another cow model. Here you can find one.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
DateTime rocket launcher timing issue 2 Answers
FPS KIT VERSION 2.0 0 Answers
Players unexpectedly change positions 0 Answers
How to make an ingame weapon/ammo shop 0 Answers