In RealityView I have two entities that contain tracking components and collision components, which are used to follow the hand and detect collisions. In the Behaviors component of one of the entities, there is an instruction to execute action through onCollision. However, when I test, they cannot execute action after collisions. Why is this?
Hi @lijiaxu
By default, anchors and their children exist in a separate physics simulation. However, you can change this behavior in Swift by getting access to the AnchoringComponent
when you load the entity and setting physicsSimulation
property to .none
:
let anchorComponent = myEntity.components[AnchoringComponent.self]!
anchorComponent.physicsSimulation = .none
myEntity.components.set[anchorComponent]
Here's the official documentation for this property.
Let me know if that helps!