playMaker

Author Topic: 2D Asteroids style movement WITHOUT physics  (Read 722 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
2D Asteroids style movement WITHOUT physics
« on: July 05, 2021, 12:54:56 PM »
Ok, so we all tried this one, and it works nicely with physics, you set your rigidbody to dynamic adjust the mass and drag, add force or even better, relative force and glide happily across the screen.

However, i'd like to have some more control over the process and i'm trying to make the same movement style using velocity. Of course, when you set the velocity, ship changes its movement direction with rotation, which is nice for a racing game or something similar, but not for space.

Anyone has the idea in what direction shoud i look for solution? Everything on the web just points out to good old physics.

Basically, ship should continue moving via the last direction player was when holding the move forward button regardless of rotation applied while it slowly, well, slows down, and it should slowly start moving towards a new forward direction when the move forward button is pressed again. Like adding relative force, but without physics.


« Last Edit: July 05, 2021, 01:50:11 PM by Fat Pug Studio »
Available for Playmaker work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: 2D Asteroids style movement WITHOUT physics
« Reply #1 on: July 10, 2021, 07:47:25 AM »
Hi.
probably with some Float Add/Subtract (per second) and/or tweens.

Check when a direction is hold, do the Float Add
You can set a Float Clamp to limit the value

The value to add/subtract per second you can manipulate by using a float tween for example.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: 2D Asteroids style movement WITHOUT physics
« Reply #2 on: July 10, 2021, 03:56:05 PM »
That's not the problem and that's how i'm doing it, but i can't figure out the drag.
Available for Playmaker work