Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Fat Pug Studio on May 30, 2017, 07:29:33 AM

Title: Draw Line Action Modification Help
Post by: Fat Pug Studio on May 30, 2017, 07:29:33 AM
Hi guys, i think it's better to post it here too, since people are rarely going into share new actions part of the forum. Anywas, since Unity 5.5, you can set the texture mode to tile or stretch on the line renderer, which i really need (actually, everyone who uses line renderer probably needs it).

I tried updating the action, but i get this error:

Assets/PlayMaker Custom Actions/Effects/DrawLine.cs(32,35): error CS0118: `UnityEngine.LineRenderer.textureMode' is a `Unresolved' but a `type' was expected

This is all i added, nothing much really:

31   [Tooltip( "Texture Mode" )]
32   public UnityEngine.LineRenderer.textureMode textureMode;

91   textureMode = UnityEngine.LineRenderer.textureMode.Stretch;
126 _lineRenderer.textureMode = textureMode;
143 _lineRenderer.textureMode = textureMode;

Any ideas, haven't seen this mistake with 'UNRESOLVED', not passing anything i shouldn't as fas as i can tell.
Title: Re: Draw Line Action Modification Help
Post by: tcmeric on May 30, 2017, 08:12:42 AM
I didnt want to mess with their action. I am not sure the right approach is to put every single option all into one action? A lot of if/thens going on in that action :)

Anyways, action attached, as well as added to my github here: https://github.com/dumbgamedev/general-playmaker/tree/master/lineRenderer

Right next to my line renderer gradient action.
Title: Re: Draw Line Action Modification Help
Post by: Fat Pug Studio on May 30, 2017, 08:20:24 AM
Wow man, that was quick. Thanks a lot, looks like i've got a lot to learn :)
Title: Re: Draw Line Action Modification Help
Post by: Fat Pug Studio on May 30, 2017, 08:58:28 AM
There's something i'm apparently missing. When i use your action, i need to have the Line Renderer on the object (obviously).

Edit: Ah, i see, the Line Renderer is created on Runtime as FSM draw line (). Argh, how am i gonna change that on runtime.
Title: Re: Draw Line Action Modification Help
Post by: tcmeric on May 30, 2017, 09:25:44 AM
You can use the other action to create the line renderer, no? I havent played with the other action.

If not, maybe I would just make an empty object, add the line renderer component to it and make it a prefab. Then call that prefab at run time as nessesary.
Title: Re: Draw Line Action Modification Help
Post by: Fat Pug Studio on May 30, 2017, 10:55:28 AM
Looks like i will be doing it like that, but then i can simply check the texture mode in the inspector :) too bad, i already made the whole fsm, bah.
Title: Re: Draw Line Action Modification Help
Post by: tcmeric on May 30, 2017, 11:55:54 AM
Lol, sometimes the easiest way is the best way  8)
Title: Re: Draw Line Action Modification Help
Post by: Fat Pug Studio on May 30, 2017, 02:39:59 PM
 8)