Hi everyone!
I’m new to Unity and I’m making the first part of the character controller using this simple script:
private float walkSpeed = 5f;
Animator animator;
//private Rigidbody rb;
void Start()
{
animator = GetComponent<Animator>();
//rb = GetComponent<Rigidbody>();
}
void Update()
{
PlayerMovement();
}
void PlayerMovement()
{
float Horizontal = Input.GetAxis("Horizontal");
float Vertical = Input.GetAxis("Vertical");
float Jump = Input.GetAxis("Jump");
float Fire3 = Input.GetAxis("Fire3");
// animations
animator.SetFloat("magnitude", Vertical);
animator.SetFloat("Fire3", Fire3);
animator.SetFloat("Jump", Jump);
// position
Vector3 newPosition = new Vector3(Horizontal, Jump * Fire3 / 2, Vertical) * walkSpeed * Time.deltaTime * (1 + Fire3);
transform.Translate(newPosition, Space.Self);
}
but the character (that have both capsule collider with isTrigger=false and rigid body) as you can see:

but it still passes throw objects (and also them have box collider with isTrigger =False), no matter what.
I’ve already tried using all kinds of different functions to move the character (as MovePosition and Velocity and addForce).
Nothing seems to works, I’ve been stuck in this all day, I really don’t know what to try to know.