Game objects can have 2 different components related to their physics.
First, you will need an engine that contains the code to simulate physics. For 3D physics, you can use NVIDIA. It is used in many 3D games that use physics such as Moonbase Alpha. Box2D can be used for 2D physics.
The two components are called colliders and rigid bodies. When an object has a rigid body, it is effected by forces such as gravity. When an object has a collider, it can be run into in that virtual world. In other words, it has a hitbox.
Humanoid figures in worlds' arms can usually go through walls because they don't have a collider. Other players in games can be shot in certain places because they have a hitbox there.
No comments:
Post a Comment