I have an ModelEntity with its physics body mode set to .dynamic
. I'm trying to make it move with: applyLinearImpulse(someVector, relativeTo: nil)
but it doesn't do anything. If I set the mode to .kinematic
and set the linearVelocity it moves but then I lose things like bouncing off walls. So how do I move entities in dynamic mode?
Making an entity move in RealityKit
Sounds like you might want to change the properties in PhysicsMassProperties
for your object when it's in dynamic mode, maybe your impulse isn't big enough.
Thanks Maxx, I tried your suggestion. It turns out that physics methods only take effect after the entity is added to the scene. I know it's fairly obvious but for some reason I tried to use the physics methods when constructing the entity.