My player goes through walls even though I have “is trigger unchecked” on player and walls, player has rigid body and box collider, and walls have a box collider. I have tried to make the box collider bigger. I have tried all options under collision detection is box collider. I am using the accelerometer on a mobile device for movement. Any help or direction would be appreciated. Posted below is the code utilizing the accelerometer.
To obey the physics system collisions, you must move your character with it. Adding force to the rigidbody or setting its velocity, for example. The translate, as mentioned, ignores physics in that regard.
There are at least 1 or 2 character physics / rigidbody examples in the standard assets. I believe one first person and one third person controller, as an example.
Even if you don’t want to look at those, you can look up the options I mentioned.
confusing…Sorry, I don’t use add force much; it does work, though, for sure.
I was testing your code and didn’t get it working properly right away.
I modified it like so:
No problem. I appreciate all of the time you are giving to help me. The player is moving! I am about to see what will happened when I use the accelerometer!
Not 100% sure what you mean by that? like there is some friction or something else?
if it’s friction, you could try adding a physics material… if it’s something else, could you try to explain somehow? heh
Sorry I’m not responsive. I’ll try to explain it better. When I am moving my player up against a wall it tends to grab onto the wall. For example, if I am holding down the left and down button trying to slide against the left wall, it may get hung up on the wall. So I then have to use the right button to get unstuck. This didn’t happen before. I’m just curious if there is a way to fix this or if that’s just the way it is. I appreciate your time so much!!!