playMaker

Author Topic: Thoughts on How to Build a Physics-Based 2D Flying Controller  (Read 2107 times)

brendang

  • Junior Playmaker
  • **
  • Posts: 63
    • Out to Play Interactive
Thoughts on How to Build a Physics-Based 2D Flying Controller
« on: October 28, 2012, 06:00:06 PM »
Hi All, a bit storm-bound here in New Jersey waiting for  'Frankenstorm' to arrive and wanted to try and come up with a 2D type character controller, but physics based.  I'm not really sure where to begin. If I was doign a simple old school movement script I'd 'GetAxis' for "Horizontal and Vertical, use a variable to tweak speed, multiple by Time.deltatime type of a thing.  But Not sure how to get a nice controllable... 'feel' with Physics.

Imagine the character has a 'neutral' float level above the ground (or water), and I would imagine I add rigidbodies.AddForce form each axis button, maybe a slight counter force when I need it to stop say, flying up?   

Any thoughts would be mighty appreciated. My basement may flood, but at least I'd come out of this Hurricane with a kickass flying, 2D scroller type controller.  ;D

If you're in the neighborhood, be safe!

Brendan

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Thoughts on How to Build a Physics-Based 2D Flying Controller
« Reply #1 on: October 29, 2012, 01:46:28 AM »
Hi,

 hopefully, you survived the flood by now...

 Study this:
https://hutonggames.fogbugz.com/default.asp?W890

 it's a fully working example, and I think it contains many of the key aspect you need to grasp in order to achieve what you want.

bye,

 Jean