playMaker

Author Topic: [SOLVED] Drawing a dynamic line  (Read 7178 times)

jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
    • View Profile
[SOLVED] Drawing a dynamic line
« on: April 12, 2012, 05: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!
« Last Edit: April 14, 2012, 02:28:43 PM by Alex Chouls »

jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
    • View Profile
Re: Drawing a dynamic line
« Reply #1 on: April 12, 2012, 05: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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
  • Official Playmaker Support
    • View Profile
Re: Drawing a dynamic line
« Reply #2 on: April 13, 2012, 04:35:06 AM »
Hi,

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

Bye,

 Jean

justifun

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 228
    • View Profile
Re: Drawing a dynamic line
« Reply #3 on: April 13, 2012, 09:08:26 AM »
You could create a cylinder primitive and simply scale it.

Mark_T

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 72
    • View Profile
Re: Drawing a dynamic line
« Reply #4 on: April 13, 2012, 02:13:52 PM »
Hi,

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

Bye,

 Jean

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






jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
    • View Profile
Re: Drawing a dynamic line
« Reply #5 on: April 13, 2012, 11:23:40 PM »
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!
« Last Edit: April 13, 2012, 11:26:00 PM by jalex19 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
  • Official Playmaker Support
    • View Profile
Re: Drawing a dynamic line [SOLVED]
« Reply #6 on: April 14, 2012, 05:22:35 AM »
Hi,

 Playmaker actions for vectrosity are coming soon  ;)

Bye,

 Jean

SirGatlin

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
Re: [SOLVED] Drawing a dynamic line
« Reply #7 on: January 23, 2015, 10:06:36 PM »
Is there an update on the Vectrosity Actions?

thanks,

-g

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous

rik

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: [SOLVED] Drawing a dynamic line
« Reply #9 on: January 24, 2015, 12:00:25 PM »
Jean i think we need an alternative mean while we find vectoricity actions are online

SirGatlin

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
Re: [SOLVED] Drawing a dynamic line
« Reply #10 on: February 15, 2015, 08:25:07 PM »
Awesome! thanks!

SirGatlin

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
Re: [SOLVED] Drawing a dynamic line
« Reply #11 on: February 15, 2015, 09: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

Ofonna

  • Full Member
  • ***
  • Posts: 230
    • View Profile
Re: [SOLVED] Drawing a dynamic line
« Reply #12 on: January 19, 2017, 01:34:32 PM »
hi i've been trying to figure this out guys please are there any inbuilt vectrosity actions for playmaker?