Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to move body during ContactAdded? #972

Closed
LittleCodingFox opened this issue Mar 10, 2024 · 1 comment
Closed

How to move body during ContactAdded? #972

LittleCodingFox opened this issue Mar 10, 2024 · 1 comment

Comments

@LittleCodingFox
Copy link

I'm trying to make a teleporter and I want the character to be teleported when touching a teleport surface, but the app freezes instead. I thought it was due to locks, but even adding lock checking code to use the NoLock variants of BodyInterface, it will then assert that it has no rights (BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::ReadWrite))

I looked at the issues and discussions and I'm not having much luck figuring this out, and I'd really appreciate some help!

Thank you very much!

@jrouwe
Copy link
Owner

jrouwe commented Mar 10, 2024

You can't move a body in the contact callback, you need to remember that the contact happened and do it after the physics simulation step finishes (and possibly reject the contact point so that the other body is not affected).

Repository owner locked and limited conversation to collaborators Mar 10, 2024
@jrouwe jrouwe converted this issue into discussion #973 Mar 10, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants