- Home /
Question is off-topic or not relevant
Possible to stop collider from "popping" through plane when re-centering?
Hey, newbie here to both unity and scripting.
I have a problem which is driving me crazy.. I have created a ladder in blender and some climbing animations (one for grabbing the ladder, one for climbing, and a final one for jumping up at the top)
I had to adjust the collider on my character when he climbs the ladder so it does not prevent him from reaching the top.
This works, however the collider is below my character after resetting it.. the collider then bounces up into the correct position on the plane, while at the same time pushing the character itself up into the air a good 2-3 feet before the character falls back down and rests on the plane inline with the collider.
I have tried to freeze the Y position however that just makes the collider stay in the ground instead of popping back up, causing the character to fall below ground.
EDIT- cleaned up and added pics Here are some pics so you can get a better understanding of exactly what I mean... http://imgur.com/4JSzjfn,ZFJgYt4,l9vdh8F,bUOoqS2
void Update()
{
if (anim.GetBool (hash.climbLadderExit) == true)
{
col.center = new Vector3(0,2,0);
col.height = 0;
}
if (anim.GetBool (hash.climbLadderReset) == true)
{
col.center = new Vector3(0,1,0);
col.height = 2;
anim.SetBool (hash.climbLadderReset, false);
anim.SetBool (hash.offLadder, true);
}
}
Answer by Scrapy_ · Apr 13, 2014 at 03:16 PM
Ok I worked this out, and figured I should put the fix here just incase somebody else runs into this kind of issue.
turns out the problem was not related to the collider, but instead was related to the animation, while trying out random things it turns out changing the animations root transform position Y "based upon" field to feet did the trick!, I did not need to bake it into the pose.. only change the field from "original" to "feet".
now my character climbs the ladder and stands up smoothly as he should xD
Answer by Jojo B · Apr 13, 2014 at 12:29 PM
you could try transforming your caracter up by one before changing the collider or alternatively move the collider over several frames allthough this will probably give a gitery sought of efect
I worked it out and posted a reply here awhile ago but I guess the mods are a bit too busy to approve it, and I have no idea how to close this question.
turns out the problem was unrelated to the collider and all I had to do was change a not so obvious setting on one of the animations, (root transform position Y - based upon to feet ins$$anonymous$$d of original).
thank you anyway for your reply Jojo
Follow this Question
Related Questions
How to get collision point when using onTriggerEnter 5 Answers
Trigger via Collider 1 Answer
Can't add Rigidbody component because collision prevents it 2 Answers
Trigger Collision with Character Controller 0 Answers
Collider2D/RigidBody2D not working 1 Answer