Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MrShoestore on April 04, 2014, 03:38:30 PM

Title: Playmaker and Vecrosity Help
Post by: MrShoestore on April 04, 2014, 03:38:30 PM
so short but sweet backstory to my issue.  I made a game in GameSalad, and trying to remake it in Unity as a way to learn my way around.  In the game, you press a button to "zoom" which moves the player fast, leaving a trail behind during the zoom. if the player dies, they restart, but the trail is still there so they can see their previous path.  in GameSalad i accomplished this by spawning a static game object every x number of frames, so the trail was a series of dots.  I always wanted the trail to be a solid line, so hoping to do that in Unity, which is why I got Vectrosity.

(http://www.asdesign.ws/wp-content/uploads/2014/04/trail_example_vid.gif)
above is relatively what I'm trying to accomplish

what I need is that when player presses the zoom button, a trail line is created with a start point at the position the player was when the button was pressed, and the end point at the players current position, updating each frame. then when the player hits a wall, the trail line must create a new point at the position it collided, with the end position still at player current.  then when "zoom" runs out, the trail line stops drawing, but does not destroy.

Is this possible with the current build of the Vectrosity Custom Actions?
Is it something that can be done with Vectrosity at all? (it seems it could)
Or am I on the wrong path and should be looking for an alternative solution?


Thanks, I know this is not much of a tech support question, but it's one of the last steps to remaking the game, so any help is appreciated.


Title: Re: Playmaker and Vecrosity Help
Post by: jeanfabre on April 08, 2014, 08:03:22 AM
Hi,

 yes, Vectrosity can let you do that, and I believe the current set of playmaker actions will allow you to work this out. Create a line and add new points everytime the direction of the gamobject changes ( like when it hit a collider)

bye,

 Jean
Title: Re: Playmaker and Vecrosity Help
Post by: MrShoestore on April 10, 2014, 08:59:36 AM
So I played around with it a bit, and somewhat got something to work.
(http://www.asdesign.ws/wp-content/uploads/2014/04/Screen-Shot-2014-04-09-at-2.23.38-PM.png)

My FSM is set up that on collision, an new vector2 variable gets updated to the players current position, and the next state is a copy of the previous vectrosity line action with the new point added.


(http://www.asdesign.ws/wp-content/uploads/2014/04/Screen-Shot-2014-04-09-at-12.52.20-PM.png)

In the scene view, I can see the lines drawn somewhat correctly, except for an added tangent line at each point.  I don't know what is creating that. 

But in the game, it displays in the bottom corner only
(http://www.asdesign.ws/wp-content/uploads/2014/04/Screen-Shot-2014-04-09-at-12.52.30-PM.png)

It also stays in that corner.  The game is setup so that the camera's position is parented to the player, so I need the line to stay in the game space, as oppose to being an overlay on top.

any suggestions?
Title: Re: Playmaker and Vecrosity Help
Post by: jeanfabre on April 11, 2014, 02:20:12 PM
Hi,

 well done!

Your layout issue is only a problem with Vectrosity camera, you'll need to ajdust the vectrostiy camera to fit exactly your scene. Have you alread tried to tweak it?

bye,

 Jean
Title: Re: Playmaker and Vecrosity Help
Post by: MrShoestore on April 14, 2014, 03:04:30 PM
alright, so here is where I'm at.  my current fsm to update the trail is not actually updating the existing trail, but generating a new trail with the same name.

(http://www.asdesign.ws/wp-content/uploads/2014/04/Screen-Shot-2014-04-14-at-1.26.03-PM.png)(http://www.asdesign.ws/wp-content/uploads/2014/04/Screen-Shot-2014-04-14-at-1.26.25-PM.png)

I think this is what is causing my tangent line issue, is that between switching states, and updating the point position variables, there is s different point recorded for the 2 lines.  How can I set up the fsm so that it does not create a new line when updating, but updates the first?


Im also still having issues with the camera.  I got it working with a camera properly set, and the lines display in the correct work position, but there is still an overlay of the lines real tiny in the bottom left corner.  How do i get rid of this? (it's kinda hard to see in the picture)

(http://www.asdesign.ws/wp-content/uploads/2014/04/Screen-Shot-2014-04-14-at-1.45.04-PM.png)
Title: Re: Playmaker and Vecrosity Help
Post by: jeanfabre on April 15, 2014, 10:32:32 AM
Hi,

 I think the trick is to layer your content and have the vectrosity camera ONLY showing its lines ( put all lines into a layer "vectrosity" for example), and the normal camera ignoring that vectrosity layer, have you tried that?

Bye,

 Jean
Title: Re: Playmaker and Vecrosity Help
Post by: MrShoestore on April 15, 2014, 02:52:19 PM
so vectrocity is creating its own camera called "VectorCam"  how do i either adjust the settings of that camera, orprevent it from creating it at all?  I was using the vectrocity get camera action to select a camera i setup just for the vectrocity lines. 

Also my vector lines do not get assigned to a layer, how do I do that?
Title: Re: Playmaker and Vecrosity Help
Post by: jeanfabre on April 17, 2014, 02:19:50 PM
Hi,

 you can manually assign a gameobject to a layer, using the action "set layer"

bye,

 Jean
Title: Re: Playmaker and Vecrosity Help
Post by: MrShoestore on April 18, 2014, 11:21:05 AM
how do I set it so Vectrosity Actions do not create a new camera, and instead use one I've already added to the scene and setup?
Title: Re: Playmaker and Vecrosity Help
Post by: jeanfabre on April 25, 2014, 08:26:03 AM
Hi,

 I am not sure actually. I would need to experiment with this.

Bye,

 Jean