playMaker

Author Topic: Floating Platforms  (Read 1951 times)

gregacuna

  • Full Member
  • ***
  • Posts: 143
Floating Platforms
« on: July 20, 2017, 07:54:46 AM »
Hey All...

I'm creating 3d system of floating platforms in the sky. I want them to gently move and figure I can do a simple iTween, but also thought to have them react to player's weight very subtly.

How would I use Playmaker to have an object appear to be floating in the air and respond to the weight of a player?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Floating Platforms
« Reply #1 on: July 20, 2017, 11:07:07 AM »
Hi,
Maybe you could make a empty parent and place you platform in it,
Then tween the movement.

On the platform have a trigger and when the player 'lands' on the platform, animate the vertical movement with the animator

If you would use weights on the platforms it will get very complicated.

gregacuna

  • Full Member
  • ***
  • Posts: 143
Re: Floating Platforms
« Reply #2 on: July 21, 2017, 01:55:58 PM »
Thanks Djaydino...that's pretty close to what I was planning, but was wondering if using physics would be too complicated and/or heavy. I'll try your suggestion and see how it looks. Cheers!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Floating Platforms
« Reply #3 on: July 22, 2017, 02:44:53 AM »
Hi,
You could have multiple animations and for example get the y velocity (drop speed)
and have less or greater vertical movement on your platform depending on that drop speed.

But it can be done in physics

I tried something like this :
Have the platform still as a child and disable gravity.
You need to freeze rotation on your platform (or clamp if you want to have some rotation).
Have a 'Get position' action (get the y position)
Then have a float compare and set a position below the platform (-3 for example)
if it reaches below -3 then use an 'add force' to 'push' it back up then get again the y position and compare
If it reaches 0, set velocity to 0 (to make a more smooth stop, you might need to use a float interpolate)
and set your platform 'Is Kinematic' else it will go down again.

I added a scene i made to show you how.



gregacuna

  • Full Member
  • ***
  • Posts: 143
Re: Floating Platforms
« Reply #4 on: July 22, 2017, 03:24:45 AM »
Hey Djaydino...

That's super nice of you. I don't have time to test it today, but as soon as I do I'll send you a message. Thanks so much! Have a great day!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Floating Platforms
« Reply #5 on: July 22, 2017, 03:32:10 AM »
Hi,
No problem  8)