How can i do "this" (hard to explain)

JlmCJlmC Member Posts: 129
edited November -1 in Working with GS (Mac)
"an image is worth a thousand words"

http://likeimg.com/images/box.png

If my helicopter is flying, i want my BOX to go on that way like i show in the picture.

What i got is the second draw. I need the third.

thanks

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Do you also want it to arch as in fall down or just go straight at that angle?

    Darren.
  • JlmCJlmC Member Posts: 129
    I want to arch it. But going straight it's also good.
  • forkliftforklift Member Posts: 386
    I think you're asking 1 of 2 things:

    1. How do I rotate the box when the helicopter moves.

    2. When I drop the box, i want it to have the same forward momentum of flight before the drop.

    Which one?
  • JlmCJlmC Member Posts: 129
    second one
  • msonesmsones Inactive, Chef Emeritus Posts: 75
    Try interpolating the X-velocity of the box from the X-velocity of the helicopter to 0 while you accelerate in the Y-direction (due to gravity). You'll need an attribute to record the velocity of the helicopter so that the box can reference it.

    Attribute: Helicopter Velocity
    Helicopter rule: Constrain attribute "Helicopter Velocity" to self.motion.linearvelocity.x
    Box rule: When swiped,
    Change attribute self.motion.linearvelocity.x to helicopter velocity
    Interpolate self.motion.linearvelocity.x to 0 over 4 seconds
    Accelerate down (I used speed 200 and it worked fine)
  • forkliftforklift Member Posts: 386
    I would store the helicopter's momentum (or linearVelocityX) as a game.attribute and upon releasing the box, the box's motion.linearvelocityX becomes the game.attribute.

    Rule on the box:
    When game.boxreleased = true
    change attribute (self.linearVelocityX) to game.HelicopterMomentum.

    Be sure if you want the box to slow its forward momentum to add a drag value in its physics attributes, otherwise it won't slow down.
Sign In or Register to comment.