Hey there folks,
i got a little problem. I use a 2D Texture (with ex2D) as the player. That player has a CharacterController attached (for movement). The level has got some flat cubes (Box Collider). IF my character walks ON these cubes, everythings allright, he walks on them and doesn’t fall, also the bool Method .isGrounded is set to “true”. BUT as soon the Character walks IN a Box (in order to test the collision i put some random cubes on his way), he doesn’t collide with the boxes, but goes just through them. But that shouldn’t happen. He should just stop and isn’t allowed to move any further.
Did i do something wrong or is there a problem with Character Collider and the other sorts of Colliders?
Are you using SimpleMove or Move to make your character walks ? Are you sure the walls aren’t triggers and that they are not on a layer not colliding with the player’s layer ?
Actually i am using the translate-Method. I guess that’s my mistake?
The walls are not triggers and not layers colliding with the player’s layer, that’s for sure.
I looked up the .Move/SimpleMove-Methods at the Script-Reference(Unity - Scripting API: CharacterController.Move), it says at a certain point:
moveDirection = Vector3(Input.GetAxis("Horizontal"), 0,
Input.GetAxis("Vertical"));
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;
The point is, i am scripting for an 2D Plattformer-Game on iOS and i am using touches, so i can’t use .GetAxis in order to do anything, i have to use my touches. How do i have to change the code in order to get it to work?
(Sry for the bad english, not a native speaker.)