playMaker

Author Topic: It's shaking indefinitely, how to smooth it up?  (Read 1354 times)

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
It's shaking indefinitely, how to smooth it up?
« on: June 02, 2019, 09:27:19 PM »
Hello,
I want to make a grid-movement 2D, but the player keeps shaking even when he's on idle. What's the solution to this problem?

(See attachment.)

I try to search in the forum and found something about FixedUpdate, but can't seem to find it anywhere in the inspector.

Please help if you know anything about it.
Thank you!

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: It's shaking indefinitely, how to smooth it up?
« Reply #1 on: June 03, 2019, 04:28:43 AM »
Is he supposed to move smoothly from square to square or just change position?
Available for Playmaker work

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Re: It's shaking indefinitely, how to smooth it up?
« Reply #2 on: June 03, 2019, 08:07:22 AM »
Hello,
it's supposed to move smoothly, or at least, progressively from one grid to another. Do you know how?
I manage to make it move instantly by using Translate before.

And apparently, reducing the collider size in the 'Player Game Object' fix the shake. I think it was caused by the edge that colliding every frame.

Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: It's shaking indefinitely, how to smooth it up?
« Reply #3 on: June 03, 2019, 11:24:39 AM »
Hi.
to move you can use float interpolate with a set position.

Get current position and store it in a variable, then if you need to go x +1,
do vector 3 opperator and add +1 to x and store in a different variable.
use those to move with the interpolate.
after the interpolate use set position once more, to set the exact position

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Re: It's shaking indefinitely, how to smooth it up?
« Reply #4 on: June 04, 2019, 02:01:53 AM »
@djaydino alright interpolate is working. I guess it can be used to many things such as 'Fade In' and 'Fade Out' effect. Thank you!

For those of you who may be wondering what I did to fix it, you can check the attachment.


Cheers,
Rechronicle

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: It's shaking indefinitely, how to smooth it up?
« Reply #5 on: June 04, 2019, 05:30:34 AM »
Hi.
Yes indeed.
There are also some other interpolate actions (color,vector2,vector3)

PlayMaker is also working on tween actions