Summary
If a new entity is created and includes an interactable component, and the transform changes immediately when those components are added, the entity will move accordingly however the Interact button will stay on the parent entity location.
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
- Enable Scene Graph System in the Project Settings
- Create a new .verse file, and paste inside the contents found in the additional notes then Build Verse Code (Ctrl+Shift+B)
- Place down an entity in the world and give it a mesh_component and a “MainComponent”
- Load into the project in the fortnite client, once inside Interact with the entity
- It should spawn a new entity on
Translation:=vector3{Forward:=-1033.0,Right:=256.0,Up:=54.0}}
- Approach the entity and see that the interact prompt is not where the entity itself is.
- Remove the
#
from line 59 ( Line containing Sleep(4.0) ) - Re-Build verse code and interact with the main component, 4 seconds later the entity should teleport to those coordinates but this time the interact prompt will also be there
Expected Result
Interactable Component moves along with the entity
Observed Result
Interactable Component wont move along with the entity if done immediately after OnBegin Simulation
Platform(s)
windows
Upload an image
Video
Additional Notes
using { /UnrealEngine.com }
using { /UnrealEngine.com/Temporary/SceneGraph }
using { /Verse.org/Simulation }
using { /Verse.org/SpatialMath }
MainComponent<public>:=class<final_super>(component):
# Runs when the component should start simulating in a running game.
OnBeginSimulation<override>():void =
# Run OnBeginSimulation from the parent class before
# running this component's OnBeginSimulation logic
(super:)OnBeginSimulation()
# TODO: Place logic to run when the component starts simulating here
Print("OnBeginSimulation")
# Runs when the component should start simulating in a running game.
# Can be suspended throughout the lifetime of the component. Suspensions
# will be automatically cancelled when the component is disposed or the
# game ends.(__verse_0xE781F91D_Forward=-1033.718977,__verse_0x296C864F_Right=256.020600,__verse_0x5782DB13_Up=53.999999)
OnSimulate<override>()<suspends>:void =
# TODO: Place simple suspends logic to run for this component here
Print("OnSimulate")
InteractableComponent:=interactable_component{Entity:=Entity}
Entity.AddComponents(array{InteractableComponent})
InteractableComponent.SucceededEvent.Subscribe(OnPressed)
OnPressed(Agent:agent):void=
NewEntity:=entity{}
NewEntity.AddComponents(array{SubComponent{Entity:=NewEntity}})
if(SIMentity:=Entity.GetSimulationEntity[]):
SIMentity.AddEntities(array{NewEntity})
SubComponent<public>:=class<final_super>(component):
# Runs when the component should start simulating in a running game.
OnBeginSimulation<override>():void =
# Run OnBeginSimulation from the parent class before
# running this component's OnBeginSimulation logic
(super:)OnBeginSimulation()
# TODO: Place logic to run when the component starts simulating here
Print("OnBeginSimulation")
# Runs when the component should start simulating in a running game.
# Can be suspended throughout the lifetime of the component. Suspensions
# will be automatically cancelled when the component is disposed or the
# game ends.
OnSimulate<override>()<suspends>:void =
# TODO: Place simple suspends logic to run for this component here
Print("OnSimulate")
MeshComponent:=BasicShapes.cube{Entity:=Entity}
TransformComponent:=transform_component{Entity:=Entity}
InteractableComponent:=interactable_component{Entity:=Entity}
Entity.AddComponents(array{TransformComponent})
Entity.AddComponents(array{MeshComponent})
Entity.AddComponents(array{InteractableComponent})
#Sleep(4.0)
TransformComponent.SetGlobalTransform(transform{Translation:=vector3{Forward:=-1033.0,Right:=256.0,Up:=54.0}})