playMaker

Author Topic: Simulate drone flying... having issues with tilt...  (Read 2290 times)

HeathClose

  • Full Member
  • ***
  • Posts: 226
Simulate drone flying... having issues with tilt...
« on: April 03, 2017, 04:31:31 PM »
so i have a 2d drone that i want to fly from one point to the other... and i want to get the speed every frame and set the rotation every frame according to how fast it's going... so like a helicopter, it tilts more the faster it goes... so as it eases in and out.. the tilt will change with the speed....

what can i use to move the object so it has an ease to it because if I use move towards or itween or the like... the object doesn't return a speed or velocity... but if I just set up a velocity or constant force... it doesn't ease at all...

any suggestions?




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Simulate drone flying... having issues with tilt...
« Reply #1 on: April 04, 2017, 01:29:56 AM »
Hi,

 Check out the sample on "Movement constraint" it has a tilting fsm that tilt based on velocity, this is exactly what you need, more or less because actually, tilt is pro active to the speed and not the opposite, but if you are faking the physics controls of the drone, it's good enough of course. IT will be also true for breaking, if you want to break the drone will first tilt and then propellers thrust will break the speed.

 Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Simulate drone flying... having issues with tilt...
« Reply #2 on: April 04, 2017, 09:33:15 AM »
Hi,

 Check out the sample on "Movement constraint" it has a tilting fsm that tilt based on velocity, this is exactly what you need, more or less because actually, tilt is pro active to the speed and not the opposite, but if you are faking the physics controls of the drone, it's good enough of course. IT will be also true for breaking, if you want to break the drone will first tilt and then propellers thrust will break the speed.

 Bye,

 Jean

i looked through my playmaker hierarchy and on the game samples wiki page.. i don't see it... where do i find this movement constraint sample

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Simulate drone flying... having issues with tilt...
« Reply #3 on: April 04, 2017, 10:14:25 AM »
Hi,

 On the Ecosystem sorry :)

 Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Simulate drone flying... having issues with tilt...
« Reply #4 on: April 04, 2017, 03:05:24 PM »
Hi,

 On the Ecosystem sorry :)

 Bye,

 Jean

I imported the movement constraint sample and I see the playmakersamples folder and the testlabs folder and the materials and textures... but there isn't any scene anywhere

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Simulate drone flying... having issues with tilt...
« Reply #5 on: April 05, 2017, 01:27:30 AM »
Hi,

 Ok, when you import from the Ecosystem and the entry goes green, you can click on it and it will highlight either the scene, the script or a menu item indicating where it is in the project.



so you should have it :)

 Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Simulate drone flying... having issues with tilt...
« Reply #6 on: April 06, 2017, 12:04:47 PM »
Hi,

 Ok, when you import from the Ecosystem and the entry goes green, you can click on it and it will highlight either the scene, the script or a menu item indicating where it is in the project.



so you should have it :)

 Bye,

 Jean

Ahhh... thank you

so I have the tilt fsm in my drone now... but I'm having trouble figuring out how to make this work in 2d... by the time i get down to the quaternion euler action I'm not sure what to use after that to work with a 2d rigidbody

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Simulate drone flying... having issues with tilt...
« Reply #7 on: April 07, 2017, 02:17:35 AM »
Hi,

 you don't touch the quat actions, it's how you check the velocity that matters, you have to pick the right axis for this. Quaternions works exactly the same for 3d and 2d, no difference here.

 Bye,

 Jean