-
Notifications
You must be signed in to change notification settings - Fork 235
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
Objects reacting to the programmatic movement of another one #43
Comments
I guess I don't know the answer! However I recommend to first search if it is possible with Box2D, and if it is then share a sample here so that I can have look. |
I just revisited this issue and read it more carefully, I think it should not be difficult to fix. If you have not solved this issue yet, can you please share a sample l can test? |
I have noticed this to, it's still an issue. You can workaround it by setting the velocity instead of position but it shouldn't be necessary imo. |
I guess the main issue here is updating c_position.c, you would need to use Body.setPosition() or Body.setTransform(). |
Well that doesn't work either cause I use |
The first teleport actually works fine in the link. I will make an example to see how things are. |
Here is a working demo: https://piqnt.com/space/1ICyExOEW The only caveat was that you need to awake at least one of the bodies after setPosition(). |
@shakiba wow this is a small fix that opens up a huge range of opportunities for use in games. Thank you! |
I need the objects of my world to react as another 'special' object passes by and touches them. For technical reasons, I am setting the position of this special object programmatically (setting the
theBody.c_position.c.x
andtheBody.c_position.c.y
properties).Suppose I position the special object
obj
at a certain point (x,y) around which there other objects.obj
is located properly (I can see it moving) but it does not seem to affect the surrounding objects when touching them. Instead, it just overlaps them and is just drawn on top of them.What am I missing here? I suspect the problem has to do with motion, but the only thing I have at hand is the desired location of the object I need to move programmatically.
The text was updated successfully, but these errors were encountered: