playMaker

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

jalex19

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

jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Drawing a dynamic line
« Reply #1 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

jeanfabre

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

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

Bye,

 Jean

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Drawing a dynamic line
« Reply #3 on: April 13, 2012, 12:08:26 PM »
You could create a cylinder primitive and simply scale it.

Mark_T

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 72
Re: Drawing a dynamic line
« Reply #4 on: April 13, 2012, 05: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
Re: Drawing a dynamic line
« Reply #5 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!
« Last Edit: April 14, 2012, 02:26:00 AM by jalex19 »

jeanfabre

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

 Playmaker actions for vectrosity are coming soon  ;)

Bye,

 Jean

SirGatlin

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

thanks,

-g

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

rik

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

SirGatlin

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

SirGatlin

  • Playmaker Newbie
  • *
  • Posts: 17
Re: [SOLVED] Drawing a dynamic line
« Reply #11 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

Ofonna

  • Full Member
  • ***
  • Posts: 230
Re: [SOLVED] Drawing a dynamic line
« Reply #12 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?