- Home /
Why does this happen to my capsule collider at runtime?
Authortime:
Runtime:
is it just a display bug? what's going on? i've not gotten as far as moving this guy around yet, but i figure this might be an issue when i do
$$anonymous$$aybe this will help. This is how it looks when i select the parent of the thing that capsule collider is on.
The parent has a navmesh agent
Authortime: http://puu.sh/cJQHs/a97f8e4204.jpg
Runtime: http://puu.sh/cJR2L/6ac1ad0bbb.jpg
Answer by Nanako · Nov 09, 2014 at 10:04 PM
Okay i seem to have figured out what's wrong, i removed the rigidbody and the navmesh agent from the child, and added the rigidbody to the parent. This is how it was supposed to be in the video.
Probably the double navmesh agents were what was causing it.
Answer by Baste · Nov 09, 2014 at 07:37 PM
It's most probably the navmesh agent causing this.
Navmesh agents wants to be placed perfectly at the navmesh. This means that they'll often move the underlying object quite a bit when you press play, as they move into a position where they can move around.
There's several settings you can adjust on the navmesh agent. Height and base offset are the ones I can see causing this - try to decrease the base offset first, to see if that helps. I also really, really recommend having the navmesh agent and the collider on the same object, otherwise they might interact strangely.
Present values on those settings are: Height: 2 (which is also the height of the capsule collider) Base Offset: 0
any specific recommendation? I'm in new territory here
I had something like this a couple of years back, without using the Navmesh at all. It was something to do with how I had parented the objects and possibly something to do with scale... I will see if I can find an old copy of it. It may well be the Navmesh as Baste says, its just that it looks so similar to what I once had.
Re; Parenting: The way i've got it setup is just how the tutorial taught me to do it, i thoughtit was a little odd.
$$anonymous$$ain object (char_robotGuard): Has a giant 10m radius sphere collider, used for detection sound and vision. Has the navmesh agent too.
Child object (char_robotGuard_body): Has the capsule collider shown here, a rigidbody, and ALSO a navmesh agent.
I think i may have messed up somewhere, i'm going to go back and recheck the tutorial video slowly
Add one component at a time, and test thoroughly with each change. Then you can hopefully see which bit causes this. I've not yet had a look for that old project but will let you know if I do and what caused it in that :)
Your answer
Follow this Question
Related Questions
Unity Crashes when decompressing Stealth assets 3 Answers
Question on Unity Project: Stealth - Chapter 1 - Video 2 at the beginning 2 Answers
What happened to the stealth tutorial page? 1 Answer
Why does my navmesh not stop at this wall? (stealth tutorial) 1 Answer
Stealth Tutorial: NullReferenceException with AlarmLight 0 Answers