If you want a physics body which moves directly under your control you can either:
Make it static and moved directly, just like any display object
Make it dynamic, welded to a static, sensor object and move the sensor like a display object
Make it dynamic, attach a couple of touch joints to it and move those where you would like it (this gives you position and rotation control)
I should point out that I have, in the past, seen problems with static non-sensor bodies being moved as if they are display objects. You will definitely see problems (such as the object suddenly disappearing with no detectable errors) if you move a dynamic body as if it’s a normal display object.
@davebollinger is absolutely correct. You should be working with the physics engine to move physics objects. There are workarounds, but in the end you’ll be causing yourself pain (and lose) if you fight the engine.
If you find that a dynamic physics body is not updating (tracking display object), because you are manually modifying the position and/or rotation , the body is probably asleep. (Note: transition.* counts as manually modifying in this context.)
If the body is dynamic , forces and set velocity functions will move it.
If the body is kinematic , set velocity functions will move it.
If the body is static , it is not meant to move and the physics engine will not expect it to.
You must also remember/realize, transition.* and physics are completely ignorant of each other. I’m not even 100% sure if the transition.* changes occur (within a frame) before or after the physics calculations for that frame occur.
Regardless, if you’re trying to achieve some sinusoidal or circular body movement using transition.*, while using physics properties to make the object behave like a platform that pushes or lifts your character… I’m not sure that you can do this in a pleasing manner.
Can you:
a. name some games that have platforms that move like this.
and/or
b. give some example links to videos of other games that have a movement like you’re trying to achieve with this platform? Please also include the time in the video where this happens.
i.e. Don’t describe the problem in terms of the question you’re trying to solve. Describe it in terms of how it fits into and is used in your game.
That looks more like you want an animated sprite and a basic body that follows its position. I say that because in your video, the image is a rounded cloud an you can’t make a body that fits that shape exactly anyways. Also, I’m not seeing how that cloud can be a platform. The shape looks wrong.
Finally, I meant (names and YouTube links for) released games. No idea is new so the motion you’re trying to create/mimic must have some corollary in existing games.
I did not find what I wanted for that I recycled an old video found on the net. The deck should barrack to make it difficult for the player to stay up so that he needs to be careful not to fall.
I’m trying to do this with the help of a joke even though certain special effects like transactions can not create them.
I’m sorry I’m not very clear. Keep trying if I can get what I want to let you know for curious
If you are moving the physics body manually (not using physics forces and functions) The platform will not support objects in the way you want it to.
i.e. The behavior and physical feedback will be hinky.
You’re definitely going to want to use some variants of @horacebury’s suggestions.
Note: I’m done for the day so I won’t be answering back further. I’m not ignoring you, I’ve just gotta get on to other work for now. Time is money and all that.
If you want a physics body which moves directly under your control you can either:
Make it static and moved directly, just like any display object
Make it dynamic, welded to a static, sensor object and move the sensor like a display object
Make it dynamic, attach a couple of touch joints to it and move those where you would like it (this gives you position and rotation control)
I should point out that I have, in the past, seen problems with static non-sensor bodies being moved as if they are display objects. You will definitely see problems (such as the object suddenly disappearing with no detectable errors) if you move a dynamic body as if it’s a normal display object.
@davebollinger is absolutely correct. You should be working with the physics engine to move physics objects. There are workarounds, but in the end you’ll be causing yourself pain (and lose) if you fight the engine.
If you find that a dynamic physics body is not updating (tracking display object), because you are manually modifying the position and/or rotation , the body is probably asleep. (Note: transition.* counts as manually modifying in this context.)