- Home /
physic 2d bug with mass n triggers!?
hello all!
I am making a 2d platformer game. From first of my start I set the engine gravity (2d) to -30 instead of -9.81. then I made my game. In level design time I thought it is better to change the gravity to -9.81 again and change the mass of each object instead. I did that and I was not happy with result so I backed to gravity -30 again. Now any new game object that I am making with a collider-trigger in it give me a bug! my main character can jump normally exactly like I want in other places but as he enters to a trigger the jump is really high! (in area of trigger only) it seems engine using 2 gravity! -30 in normal places and -9.81 in triggers! is there a way to reset this? Is it a bug? or I missed something? I am using unity 2018.2.16f1personal. Thanks for any help! plus I tried to make a empty game object and added a collider-trigger but in that empty game object with only a trigger it works fine! I am super confused!
Thats improbable but without the code i cant help you much. Put a debu.log for loging gravity when user trys to jump and tell us if actually gravity changes inside and outside the trigger.
Answer by Refar8 · Jan 16, 2019 at 03:00 PM
Thanks @xxmariofer . I added that debug.log and the gravity was -30 for both in trigger and outside of that. I found the problem myself. it is because the layer was on ground and in the trigger area it told my character you are on ground and you can do jump! and this order told the character in every bit of trigger and that was the reason a lot of force rapidly applied to rigid body of my character and produce a high jump in trigger area!
Your answer
Follow this Question
Related Questions
Why are my OnTriggerEnter2D events firing only on android in a situation they shouldnt be firing? 0 Answers
Multiple Collider of Platform Effector overlap Problem 1 Answer
Collision with instantiated non-moving objects. 1 Answer
OnTriggerExit2D Does not work 1 Answer
Trigger and raycast error? 2 Answers