Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: jalex19 on April 12, 2012, 08:07:16 PM

Title: [SOLVED] Drawing a dynamic line
Post by: jalex19 on April 12, 2012, 08:07:16 PM
I've got most of the mechanics of my Gold Miner varient set up. However, I'm looking for a good solution to draw a line between my base and my hook when I shoot, similar to this(playable demo half way down the page):

http://www.emanueleferonato.com/2008/10/04/create-a-flash-game-like-gold-miner/

Currently I am using an object attached to my hook and scaling it up (itween scale to) at the same rate that the hook translates  (itween move by) away from the base - however this is a bit clunky and the line sort of "stutters" a bit as the scale and the distance are updating independently (though theoretically at an identical rate).

It seems like there should be a cleaner solution to this, that would update seamlessly. Ideally I'd like to do this with something I could texture, but I'd settle for a line that I could just color.

Any info is appreciated!

Thanks!
Title: Re: Drawing a dynamic line
Post by: jalex19 on April 12, 2012, 08:47:31 PM
Draw debug line gives me some of this functionality, however, there is no option for a texture, there is no sorting so it goes over things it should be behind, and of course, it's a gizmo so I can't use it in a build :P
Title: Re: Drawing a dynamic line
Post by: jeanfabre on April 13, 2012, 07:35:06 AM
Hi,

 Have you check vectrosity?: http://starscenesoftware.com/vectrosity.html (http://starscenesoftware.com/vectrosity.html)

Bye,

 Jean
Title: Re: Drawing a dynamic line
Post by: justifun on April 13, 2012, 12:08:26 PM
You could create a cylinder primitive and simply scale it.
Title: Re: Drawing a dynamic line
Post by: Mark_T on April 13, 2012, 05:13:52 PM
Hi,

 Have you check vectrosity?: http://starscenesoftware.com/vectrosity.html (http://starscenesoftware.com/vectrosity.html)

Bye,

 Jean

I would love to have Playmaker actions for Vectrosity. :)





Title: Re: Drawing a dynamic line
Post by: jalex19 on April 14, 2012, 02:23:40 AM
Vectrosity looks nice, but I was hoping for a solution within Unity or PM (not about the cost really but more just adding another piece of middleware that I would only use like 1% of). I think I came up with a solution using a different scaling method - if that's too expensive then I may look at Vectrosity to optimize...

I ended up doing scaling of a game object - I had done it before but with a different method (described above) that led to really clunky results.

Here I used "Get Position" and "Set Scale" and simply recorded the value of the Y position of the hook every frame and stored it in a variable, and then access that variable to set the scale of my cable every frame.

The results are much smoother than before.

I'm not sure if running these actions every frame (inside a small time interval) is expensive (to the point where it's not a good idea) if this is, let me know - but so far I'm happy with it!


Thanks!
Title: Re: Drawing a dynamic line [SOLVED]
Post by: jeanfabre on April 14, 2012, 08:22:35 AM
Hi,

 Playmaker actions for vectrosity are coming soon  ;)

Bye,

 Jean
Title: Re: [SOLVED] Drawing a dynamic line
Post by: SirGatlin on January 24, 2015, 12:06:36 AM
Is there an update on the Vectrosity Actions?

thanks,

-g
Title: Re: [SOLVED] Drawing a dynamic line
Post by: Lane on January 24, 2015, 08:09:29 AM
https://hutonggames.fogbugz.com/default.asp?W948
Title: Re: [SOLVED] Drawing a dynamic line
Post by: rik on January 24, 2015, 02:00:25 PM
Jean i think we need an alternative mean while we find vectoricity actions are online
Title: Re: [SOLVED] Drawing a dynamic line
Post by: SirGatlin on February 15, 2015, 10:25:07 PM
Awesome! thanks!
Title: Re: [SOLVED] Drawing a dynamic line
Post by: SirGatlin on February 15, 2015, 11:42:45 PM
Hmm, Are there any Vectrocity 4 actions? when I import this package, it seems to crash my Unity and make me "revert layout to default"


-g
Title: Re: [SOLVED] Drawing a dynamic line
Post by: Ofonna on January 19, 2017, 03:34:32 PM
hi i've been trying to figure this out guys please are there any inbuilt vectrosity actions for playmaker?