I have a gameObject with has a sphere collider and a rigidbody. Sphere collider is all set to defaults and is unchanged from me adding it. The rigidbody, all the variables are set the default, apart from the collision detection, which is set to ‘Continous’.
I’m using rididbody.MovePosition, which is supposed to recognise physics collisions. It recognises ‘some’ of the collisions, however others (certain terrain angles), it doesn’t pick up. I’ve manually done AddForce and the objects have followed the same trajectory and made collisions. So I know it’s not it’s trajectory path itself, it’s it’s collisions upon moving.
Does anyone know of a problem with my script? Asides it being super basic right now :P.
Any help if possible. I really want to know what’s causing the objects to travel through terrain ‘sometimes’, and hit other times, while I’m using rigidbody.MovePosition().
MovePosition is not constrained by collisions. If you are seeing what appears to be constraining, it is ptobably the interpenetration solver fixing things. Unless you wish to do your own collision test sweeps you are surely easier off modifying velocity rather than position.
The reason being I think the drag function Unity uses is the standard drag equation: Force Drag = 1/2 mass density * flow velocity relative to object * Drag Coefficient * Area. I don’t know how they’ve tallied up flow velocity (air pressure) in their case. I don’t know whether they’re considering mass density as well. They are asking you to add a mass, but I’m not sure whether they’re putting a calculation of that vs the area of mass and the cross sectional density of the object relative to it’s trajectory. I would be able to make an algorithm to measure mass density and things myself, but I don’t know HOW the physics in Unity is being calculated :(. Plus this constant drag model only works on subsonic speeds.