Quick Links: Download Gideros Studio | Gideros Documentation | Ultimate Guide | Gideros Development Center
What would be the best way to move a Body (Physics) horizontally / back and forth - Gideros Forum

What would be the best way to move a Body (Physics) horizontally / back and forth

Ninjadoodle Member
edited November 24 in General questions
Hi guys

I'm trying to find the best way to do this, and though that tweeting might be a simple option, but can't seem to tween a physics object.

I also though about using some joints etc. Have you guys got any ideas you have used before?

Thanks in advance!

Comments

  • I have played around with Box2D physics for quite a while, both moving bodies and using joints. What are you looking to do?
    +1 -1
  • @Ninjadoodle, it depends what you are trying to achieve. A kinematic body is the easiest to use if you just want to move something about. do you have a scribble of what you want to do?
    +1 -1
  • In Scrappy Cat I used Kinemati bodies as platforms, and I tweened them by using setLinearVelocity(), easing in and out to make it feel more natural.
    +1 -1
  • Ninjadoodle Member
    edited November 24
    Hi guys thanks for the replies!

    @totebo - that’s exactly what I’m looking for. Do you have an example of how to tweet linear velocity - I’m getting confused on that one :)

    @antix - here is a scribble of what I’m trying to do. I’m currently moving the ball dispenser instead of the basket. I would however like to move the basket without breaking the physics.

    Thank youuuuuu!

    Aye: antix

    +1 -1 (+1 / -0 )
  • Personally I'm wondering why box2d is even required here :)
    +1 -1
  • Ninjadoodle Member
    edited November 25
    @antix - I'm planning a whole bunch of levels along the same lines. The tennis balls will be visible inside the basket (see through net) and bouncing/rolling around as the basket moves. The main reason for box2d is that the other ideas I have definitely require it (or at least make it easier to code).

    The only issue I currently have is tweeting the basket without breaking the physics simulation.
    +1 -1
  • Hmmm, I managed to get a sample working using box2dEasy and it seems to work well.

    I wonder whether its a good way to go?
    +1 -1
  • @Ninjadoodle, if it works as you intended then it's a good way to go. If later on it becomes problematic then deal with it at that point :)
    +1 -1
  • @ninjadoodle, tweening a body using setLinearVelocity() is quite easy; just use it instead of setPosition() to keep the physics simulation intact.

    Aye: antix

    +1 -1 (+1 / -0 )
Sign In or Register to comment.