Hi,
I made my character using a RigidBody and a Capsule Collider, but when testing it sometimes goes through “wall” colliders, when on the editor it rarely occurs but on Android it is almost like if there was no colliders at all.
My movement code is:
player.MovePosition(player.position + player.transform.forward * movSpeed * Time.deltaTime);
Where:
player = character Rigid Body
movSpeed = float of how fast it should move
I tried to do the following to, but with no success:
if (!Physics.Raycast(new Ray((player.transform.position + new Vector3(0, 1.5f, 0)), player.transform.forward + new Vector3(0, 1.5f, 0)), movSpeed * Time.deltaTime))
player.MovePosition(player.position + player.transform.forward * movSpeed * Time.deltaTime);
What can I do? Thanks in advance.