Steps to reproduce
A) Setting up the scene
- Create a Primitive Trigger area and name it
stationary
. - Create a script
TriggerScript
and attach it tostationary
. - Edit the script and implement the method
TriggerScript:OnTriggerEnter(other)
asprintf('TriggerScript:OnTriggerEnter: other={1}', other:GetName())
. - Create a Voxel Mesh, and name the entity
movable
. Seeentity-positions.jpg
for a view of the setup. - Create a script
InteractionScript
and attach it tomovable
. - Create a script property
{name='moveTo', type='entity'}
. - On the
movable
entity, set themoveTo
property tostationary
. - Implement the method
InteractionScript:Move
asself:GetEntity():AlterPosition(self.properties.moveTo:GetPosition(), 1.0)
. - Make the
movable
onInteract
event fireInteractionScript.Move()
formovable
.
B) Testing the operation
- Go into Preview mode.
- Enable the console.
- Move your player over to
movable
, and interact with it.
See this video for an example without a workaround, and then applying workaround A) listed below:
Crayta Issue - Voxel Mesh Trigger Area
Expected result
The log should show: TriggerScript:OnTriggerEnter: other=movable
.
Actual result
The log shows nothing. See actual.jpg
.
Workarounds
A) Attach a Mesh entity to movable
and use that for the logic instead. When this attached Mesh entity enters the trigger area, it will be activated.
B) Turn on physics for the Voxel Mesh entity.