Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Updating actor transforms in a grab end callback has unpredictable results #733

Open
in2dair opened this issue Oct 22, 2020 · 0 comments
Open

Comments

@in2dair
Copy link

in2dair commented Oct 22, 2020

On grab end, attempts to adjust the transform of the actor firing the grab end within the grab end handler are intermittently unreliable. Adding an artificial delay -- dispatching those transform adjustments in a setTimeout -- seems to improve the reliability of transform updates.

someActor.onGrab('end', () => setTimeout(() => {
    // mess with someActor parent and transform
    someActor.parent = this.somOtherActor;
    someActor.transform.local.position = Vector3.Zero();
    someActor.transform.local.position = somePosition.clone();
    someActor.transform.local.rotation = Quaternion.Zero();
    someActor.transform.local.rotation = Quaternion.Identity();
}, 0.2 /*shouldn't have to do this delay!*/));
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant