Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: hoyoyo80 on October 30, 2018, 09:29:54 PM
-
Hi all,
Anybody know how to make sine/wave movement as seen in most shootemup?
I try to use animation but i realize it use exact position.
Any easy way other that math?
Thanks
-
Hi,
you can use Curves as well, but math is likely going to be the only way for proper control.
Bye,
Jean
-
Maybe a sideways “move towards” action between two waypoints (all three things child under one patent), with the easing function (I believe sine is there too). And a different, separate FSM, that moves the parent object forward. That way, the thing would describe a sine movement, or close enough.
-
Hi,
Have you checked this: https://assetstore.unity.com/packages/templates/systems/shmup-starter-kit-for-playmaker-11070
Bye,
Jean
-
For horizontal movement:
FSM 1
1. Translate horizontally with desired speed
FSM 2
1. Create float variable vertical movement speed and set it to zero
2. Create float variable addition to movement speed
3. Add "Float Add" every frame (addition to movement speed + vertical movement)
4. Add "Float Compare" and compare vertical movement speed with desired vertical movement speed limit
5. When it hit the threshold, "Float Subtract" every frame (vertical movement - addition to movement speed)
6. Float compare again, when it reaches a defined negative threshold, repeat.
Using this way you can get a smooth sine movement, but there are certain cons to this approach, first being the dependence on frame rate because of float imprecision, the second one being making this a bit of a drag to modify amd get the values just right for desired result.
Tweening only vertically while translating horizontally does not work , so it's either this way, tweening the whole path, or code.
Edit: typos
-
Hi all, first of all thanks:)
I figure that math is the best way just wanting to explore easier method:) Since in some shootemup ive seen, the enemies move in circle pattern that move out of the screen.I thot maybe unity/playmaker have a waypoint etc.Ive read about DoTween but im not sure whether itll help.
1.jeanfabre, i would love to learn the curve. can u point some unity tutorial about this.Thanks
2.Thore, yes, thinking of that waypoint too.Thanks
3.krmko, Thanks. That could be useful.
-
I picked up this https://www.assetstore.unity3d.com/en/?stay#!/content/7515 ages ago, it comes with Playmaker actions. I don't use it at the moment as I like to avoid relying on too many assets, however it worked well when I tested it.
-
Energy bar toolkit for sine waves? I guessed you missed the thread, but yeah, it's an awesome asset, i'm using itnl too.
-
Hi,
You can use the action Sample curve to get a float value, which could be the delay for each instance based on a position ratio from the vessel.
Bye,
Jean
-
Energy bar toolkit for sine waves? I guessed you missed the thread, but yeah, it's an awesome asset, i'm using itnl too.
Massive oops, sorry must have returned to the wrong tab after fetching the link...