Hey Guys-
I’m making a game (3D) where I want my character to only be able to move an object with a rigidbody only when certain conditions are fulfilled.
Here are the objects in my scene:
- A player with a character controller
- A boulder with a rigidbody and mesh collider
- a ground plane with collider
Right now I have something like this on my player :
public enum States {normal, superStrong};
I was thinking something like this might work:
if (playerState == superStrong){
Boulder.GetComponent<RigidBody>().Mass = 1;}
else {Boulder.GetComponent<RigidBody>().Mass = 100;}
This works, but the problem is, the RigidBody of the boulder weighs less universally (so if another rigidbody were to collide with it, it’s mass would not be proportional) Does anyone know if there is a better way to do this? Maybe if I make the characterController mass larger? I’m not sure