playMaker

Author Topic: Set Line Render Position lags behind[SOLVED]  (Read 1824 times)

andri1305

  • Playmaker Newbie
  • *
  • Posts: 9
Set Line Render Position lags behind[SOLVED]
« 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.
« Last Edit: October 15, 2019, 09:41:05 AM by jeanfabre »

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Set Line Render Position lags behind
« Reply #1 on: September 25, 2019, 11:21:09 AM »
It's refreshed/redrawn too late?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Set Line Render Position lags behind
« Reply #2 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

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Set Line Render Position lags behind
« Reply #3 on: September 30, 2019, 06:03:12 AM »
And if you build on phone you'll reach some amazing 20 FPS!!!  ;D ;D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set Line Render Position lags behind
« Reply #4 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