playMaker

Author Topic: Draw Line 1.1 [last update: 18.05.2015]  (Read 10805 times)

Thyriax

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
    • Torii games
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #15 on: June 24, 2015, 07:03:45 AM »
Hi !
This is a great action and easy to use !
But, i've got a little bug.
When i use "Destroy on exit" option, and reactivate the FSM who have this action, it creates a default "line renderer" component . The options in the action are still here but not applied.

Good job !

Matthew

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #16 on: November 17, 2015, 06:26:34 AM »
Any suggestions for how to get the line renderer to show up in the UI Canvas?  I tried setting the line to parent the canvas and adding UI components but had no luck.  I really need a tool like this for a game that uses state machine interface.

Thanks,
Matthew

Andrew_Raphael_Lukasik

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • my twitter @andrewlukasik
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #17 on: November 19, 2015, 02:40:16 AM »
Hi @Matthew. To make line renderer show up above the UI Canvas you need to:
1. Change your Canvas component's Render Mode setting from "Screen Space - Overlay" to "Screen Space - Camera"
2. Set "Render Camera" below to you main camera
3. If line renderer is still obstructed by Ui Elements just move it closer to camera OR change Canvas Component's "Plane Distance" value

Hope it helps,
Andrew

Matthew

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #18 on: November 21, 2015, 06:55:56 AM »
Thanks Andrew!!

Pandur

  • Junior Playmaker
  • **
  • Posts: 82
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #19 on: February 09, 2016, 12:50:27 PM »
Big Thx Andrew you save a lot of my Time :D

krmko

  • Sr. Member
  • ****
  • Posts: 422
    • View Profile
    • Fat Pug Studio
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #20 on: August 04, 2016, 10:14:53 AM »
I have to ask, why this fantastic action is not in the ecosystem? Please make it so :D

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2274
    • View Profile
    • jinxtergames
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #21 on: August 05, 2016, 06:41:17 AM »
Hi,
The Action can now be found on the Ecosystem.  ;)

NateGallardo

  • Playmaker Newbie
  • *
  • Posts: 26
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #22 on: September 25, 2016, 10:31:23 AM »
Hi Andrew,

I'm using your great Draw Line action, but I'm not sure if I've run into a bug, or if I'm just misunderstanding a particular aspect of it.

I have a state in which I use Draw Line to create a line between two game objects, and parent it to one of those objects. When I leave the state, the line persists in the scene. However, when I re-enter this same state, the previous line is destroyed, and a new one is created. I don't have Destroy On Exit checked, and I'm not sure what I need to do to ensure the line persists.

I've attached a screenshot to illustrate my FSM setup.

I found that if I went into the action code and commented out line 113, that the line does then persist as I expect. That line is:
"Object.Destroy( goLineRenderer.Value );"

I've attached another screenshot to illustrate where in the code that occurs.

So, am I just not using the action correctly, or have I found a bug?

Cheers :)
Nate

cwmanley

  • Full Member
  • ***
  • Posts: 106
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #23 on: September 26, 2016, 02:04:10 AM »
Hello,

I don't think it is a bug.

You might need to edit the DrawLine Action.

Actions that create and destroy can be a pain.

I would prefer a FSM variable so I can handle creating and destroying things myself, but it is not a big deal.

You can learn a lot from tweaking actions, don't be afraid to make things work the way you need them to.

Just make a new FSMGameObject Variable for the LineRenderer.

If you have any problems look at similar actions or pm me.

Thanks

NateGallardo

  • Playmaker Newbie
  • *
  • Posts: 26
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #24 on: October 02, 2016, 01:22:42 PM »
Yep you're right, I got stuck in and made a few tweaks.

I added the ability to specify whether or not to use world space for the line, so you can parent it to another object and it'll move with it. I also modified it to fix the behaviour I mentioned in my previous post.

I've attached my modified version of the script in case it helps anyone :)

spektron

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #25 on: February 19, 2017, 06:05:21 AM »
Thanks for the action!
Encountered an error with these settings:
spaceMode=self
AlightInSpaceModeSelf=true
DestroyOnExit=true


when I return to the state with the drawline action, I got this error:
"missing reference exption the object of type transform has been destroyed but you are still trying to access it".

with the following doesnt happen.
spaceMode=world
AlightInSpaceModeSelf=false


suggestions?
thanks

LordHorusNL

  • Junior Playmaker
  • **
  • Posts: 76
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #26 on: April 12, 2017, 11:49:05 AM »
I have 2 problems with this action when using with VR controllers.

I'm trying to simulate a laser pointer from my controller to a target 20 meters away, this works but when i move the controller the line laggs behind and looks all wobbley. (like if it where attached to a joint or something)

Second: when using a material it always shows up as black and if i only use a color it never matches with the color i pick in the editor.

Anybody else have these problems?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12344
  • Official Playmaker Support
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #27 on: April 13, 2017, 12:44:05 AM »
Hi,

 - use actions that works on lateUpdate else you will get this lag. so for example use "SetPositionAdvanced" on the Ecosystem, each "advanced" version will give you this possibility to set when to executed the action, not just on update, but on fixed and late too. IF you need an action that doesn't support this, let me know, I'll do it.

 Bye,

 Jean

LordHorusNL

  • Junior Playmaker
  • **
  • Posts: 76
    • View Profile
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #28 on: April 13, 2017, 06:24:47 AM »
Thats not an option, i have this action running directly on my Vive controller, so i'm not using any other actions to move the object (controller)

I'll try parenting a seperate object to the controller and put the action on that (using advanced set position)

krmko

  • Sr. Member
  • ****
  • Posts: 422
    • View Profile
    • Fat Pug Studio
Re: Draw Line 1.1 [last update: 18.05.2015]
« Reply #29 on: May 29, 2017, 03:07:26 PM »
Hello guys,

from Unity 5.5 it's possible to choose between Stretch or Tile in the Line Renderers Texture Mode. Any chance of implementing that choice in the action? It's really useful and a solution to a problem that's been troubling many users for a long time (dynamic stretching needed to be done on runtime if you want it tiled).

As far as i can see, nothing too hard (_lineRenderer.textureMode = ...) but i don't want to mess someone else's actions :)
« Last Edit: May 29, 2017, 10:59:23 PM by krmko »