playMaker

Author Topic: I wrote a Bezier Quadratic Move Action. If you need, get this.  (Read 1717 times)

braincase

  • Playmaker Newbie
  • *
  • Posts: 19
I wrote a Bezier Quadratic Move Action. If you need, get this.
« on: January 12, 2019, 04:08:29 AM »
I wrote a bezier curve movement Action.
The math solution is from Wikipedia on 'bezier curve' section.

Basically I made this action for a 'Granade launcher' of my game. I used 'slerp' movement but I think Bezier quadratic is better than slerp.

this is very easy to use.
assign start, target, traveler(arrow, ball..etc.) gameobjects.

-auto handle mode
Curvature handle will automatically be between start position and target position.
you can adjust the handle's height to manage the curvature.

-custom handle mode
Assign a gameobject for custom handle.

-randomize curve option.

-rotate along the curve option.

-you can Debug curve line on editor.


hope this can make some people happy.
Let me know if you have some good idea for improving the action.(better optimization...option...anything.)

Thank you for reading this.

/edited/
-Added 'Prevent Too Narrow' option.
When shooter and target is very close, the bezier curve can be extremely narrow.
So the projectile's movement can be very strange. This option modifies bezier curve automatically.(lower the height of curve)

-optimized a little bit. Reduced some calculation during onUpdate().
« Last Edit: January 13, 2019, 03:20:53 AM by braincase »

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Re: I wrote a Bezier Quadratic Move Action. If you need, get this.
« Reply #1 on: January 12, 2019, 12:02:01 PM »
I am searching whole Youtube for this.
Thank you buddy :)

Downloading ;)

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: I wrote a Bezier Quadratic Move Action. If you need, get this.
« Reply #2 on: January 17, 2019, 01:41:01 PM »
This looks awesome, I'm excited to try it out, thank you for sharing :D