playMaker

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

braincase

  • Playmaker Newbie
  • *
  • Posts: 14
    • View Profile
I wrote a Bezier Quadratic Move Action. If you need, get this.
« on: January 12, 2019, 02: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, 01:20:53 AM by braincase »

heavygunner

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

Downloading ;)

craigz

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