Player running through walls

After running the code if I set the moveSpeed above 10 the player goes through the wall. Need to have a different call code. If I use :
void Start()

{

    _td = Time.deltaTime * moveSpeed;

    m_Rigidbody = GetComponent<Rigidbody>();

    PrintInstructions();

}

void FixedUpdate()

{

    MovePlayer();

}

void MovePlayer()

{

   m_Rigidbody.velocity = transform.forward * -_td;

}

This will move the player without going through the wall at a faster speed but only one direction…how can I add to this for full controller/keyboard support?

Hi, i’m not sure on this, but i believe if you change the rigidbody collision mode on the walls,
it should work too? You can test it anyways, else you better wait for someone else to answer,
they can help you better, gl with your game!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms