Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: andri1305 on September 22, 2019, 05:50:42 AM

Title: Set Line Render Position lags behind[SOLVED]
Post by: andri1305 on September 22, 2019, 05:50:42 AM
I have a line rendered between two objects using Line Renderer component, and to make the line follow the points I've added Get Position and Set Line Render Position, both have every frame enabled, but the line lags behind when moving the objects.
Title: Re: Set Line Render Position lags behind
Post by: Broken Stylus on September 25, 2019, 11:21:09 AM
It's refreshed/redrawn too late?
Title: Re: Set Line Render Position lags behind
Post by: djaydino on September 25, 2019, 01:02:07 PM
Hi.
Have you tried in a build?
As in editor several factors can slowdown your game.
For best result make sure only the game window is visible.

if scene is visible during play it will reduce fps, if playmaker window is visible it will reduce fps, if inspector is visible it reduces fps.
and even when none of the are visible it is still not at full fps.

for example on a project i work on, when all windows are visible i get like 10-15 fps.
when i hide some, i get upto 40 fsp.

when all are hidden i reach 140fps.

When i test in a build on windows i reach 500+ fps
Title: Re: Set Line Render Position lags behind
Post by: Broken Stylus on September 30, 2019, 06:03:12 AM
And if you build on phone you'll reach some amazing 20 FPS!!!  ;D ;D
Title: Re: Set Line Render Position lags behind
Post by: jeanfabre on October 15, 2019, 09:40:55 AM
Hi,


 It's because the action is setting the position on Update.

 I updated the action so that you can now execute it on LateUpdate, you also need to get the position you want on late update, for this, use the custom action GetPositionAction and also set it to lateupdate, then you won't get any lag.

Please download these actions from the Ecosystem.

Bye,

 Jean