Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: holyfingers on November 07, 2017, 09:49:19 AM

Title: ArrayList Get LineRenderer Positions
Post by: holyfingers on November 07, 2017, 09:49:19 AM
Hi there,

I recently put together an action to get all the positions along a Line Renderer curve as an Array of Vector3s, using LineRenderer.Getposition.

It's based on this Get Vertex Positions Action: http://hutonggames.com/playmakerforum/index.php?topic=3982

(https://i.imgur.com/JO5CICw.gif)

The yellow spheres here are having their positions set to each curve position every frame... 

At the moment it cycling through the points and adding them to the array, there is a lineRenderer method to get them all at once (https://docs.unity3d.com/ScriptReference/LineRenderer.GetPositions.html) which I assume would be much more efficient, but I couldn't get it to work!

I've also updated my Draw Curve actions to allow you to specify a Game Object variable for the Line renderer to make it easier to work with this action: http://hutonggames.com/playmakerforum/index.php?topic=11193.msg74970#msg74970

Let me know if you have any thoughts!

Cheers,

Nick
Title: Re: ArrayList Get LineRenderer Positions
Post by: jeanfabre on November 08, 2017, 03:49:44 AM
Hi,

 excellent!


Bye,

 Jean
Title: Re: ArrayList Get LineRenderer Positions
Post by: Fat Pug Studio on November 08, 2017, 10:07:28 AM
Wow, this is awesome!
Title: Re: ArrayList Get LineRenderer Positions
Post by: djaydino on November 08, 2017, 02:42:25 PM
Hi,
Very Nice!