Function ambient_api::physics::add_force
source · pub fn add_force(entity: EntityId, force: Vec3)
Available on crate feature
server
only.Expand description
Applies a force
(a Vec3) to the entity
(an EntityId) specified.
force
is a vector in world space, which means it has both direction and magnitude. To push objects upwards
(positive Z) with strength 3,000, you would supply a force of vec3(0.0, 0.0, 3_000.0)
or
Vec3::Z * 3_000.0
(either are equivalent.)