playMaker

Author Topic: Vectrosity Actions: Generated Shapes Not Grouped Properly[SOLVED]  (Read 6824 times)

memetic arts

  • Full Member
  • ***
  • Posts: 141
Hello . . .

I was very happy to discover the set of Vectrosity Actions that Jean created, but seem to be having an inexplicable problem. 

When I use the MakeCircle action (or any shape for that matter), while the circle gets generated, if you look at the Hierarchy pane, you can see the object is not a child of the FSM object.  Since I'm animating the object on a spline, this is easy to observe -- I can see the Action Label moving around with the FSM object, but the circle just sits there at its origin. 

I've tried manually parenting the object via script, but Vectrosity complains . . . so not sure what to do.  Certainly I must be overlooking something very simple.

Any help would be very much appreciated.  Thanks!!

« Last Edit: June 19, 2013, 12:51:02 AM by memetic arts »

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly
« Reply #1 on: March 20, 2013, 12:29:24 PM »
Sorry, I'm bumping this only because I'm tearing my hair out here .  . . I think maybe a more accurate way to phrase the question is:  how do you get a dynamically created object to appear in the same coordinate system as the object that holds the script that spawned it?

I manually moved the object in the hierarchy into it's "parent", and while it immediately began to follow the spline, it was literally off the grid - so obviously a coord system issue.  My problem is that I have no way to programmatically reference it by name until after it is created -- so it doesn't show up in the Game Object list; and when assigned a variable, the Variable list only has the "none" option.

I'm also starting to realize that this may not be just a PlayMaker issue, but hopefully someone out there will indulge me . . .

Thank you again . . .

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly
« Reply #2 on: March 21, 2013, 02:16:46 PM »
bumping this up again, sorry.  But really could use some help with this.

Anybody?

thank you again.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly
« Reply #3 on: May 14, 2013, 04:45:54 AM »
Hi,

 Sorry, completly missed your posts... Going backward on all my unread posts at the moment.

 It works fine here. I have saved the shape in a FsmGameObject in the "storage" section of the action, and then I can use the SetParent action.

 What errors do you get when you do so?

bye,

Jean

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly
« Reply #4 on: May 14, 2013, 10:36:57 PM »
Ha, thanks for the response at last, Jean.  :)

I'm actually juggling projects and had to put this one on the back burner for the moment . . . just opened up the file, and have no idea what i was doing.  :)   Need to spend a bit of time to get my head back into it . . . i have a feeling that you know what i mean . . . :)

so probably in a couple of days after i wrap up my current workstream .  . .

thanks again!

gauthi24

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly
« Reply #5 on: May 27, 2013, 12:39:09 PM »
Hey there,

I could really use this ".setParent" method... where can I find the Vectrosity Actions package that has this. I looked online at Vectrosity Custom Actions here: https://hutonggames.fogbugz.com/?W948 , but .setParent was not listed as one of the custom functions.

Can someone provide a link?

Many thanks!

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly
« Reply #6 on: June 17, 2013, 10:58:40 AM »
@gauthi24: have been heads-down on other work, so haven't been to the boards lately, apologies for not replying sooner.

SetParent is not a Vectrocity method, it's native Unity.  You can find the PM Action in the GameObject section, or, more easily, by just typing "setparent" in the Action Browser's search field.

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly
« Reply #7 on: June 18, 2013, 12:06:00 PM »
@JeanFabre -

I finally got my head back into this issue, and was able to parent the Vectrosity-generated circle.  Unfortunately, my original problem persists.  So here's what's happening:

I have a GO with a script attached that generates a spline.  Using an FSM on the same GO, I set the GO's position to Point #1 on the spline, and animate/loop it through 6 points using the iTween MoveTo action.

If I manually create a sphere object and make it a child of the GO (e.g. drag it to the GO), and run it, the sphere animates as expected, right along the spline.

However, if I instantiate a Vectrosity object (in this case a circle), and set the GO as the parent, the Circle's position cube/arrows/gizmos appear in the right place, and animate properly, but the circle object itself is hugely offset and rotated.

Of course I thought it was a world vs. local coordinate issue, but I can't seem to find any params/methods to control that - even in the Action settings, toggling the world/self options have no effect.

I really thought that parenting the object would have solved it, but apparently not . . . I can post a screenshot if need be . . . any suggestions would be greatly appreciated.

Thanks!!

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly[CLOSED]
« Reply #8 on: June 18, 2013, 05:41:30 PM »
After some additional research, there are strong indications that this issue has to do with instantiating the object as Vector2 and trying to plot it in 3D space (as opposed to 2D screen space).

I'm not quite sure how to deal with it just yet, going to hit the Vectrosity demos/docs and see what shakes out.

The only PM follow-up to this would be a request to maybe add params for Vectrosity features like Vector.up/forward, and Vector2 vs. Vector3 lines.  When I get brave enough to create my own Actions, maybe I'll take that on myself.  :)

If anyone has a clue/shortcut to solve this, that would be awesome; and if anyone is interested in knowing how this gets resolved, just say the word and I'll post the outcome.

In the meantime, I'll declare this specific issue as "Closed" (but not "Solved"!).

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly[CLOSED]
« Reply #9 on: June 19, 2013, 12:50:39 AM »
So, to continue, and conclude, this fascinating conversation with myself, I'm happy to report that I've resolved the issue regarding the offset and rotation quirks, and it was, in fact due to the fact that I was trying to set the Vector2 Circle with Vector3 coordinates.

While this can't currently be resolved in PlayMaker without modifying the MakeCircle action (because there is no Vector2/Vector3 option, and Vector3.up is not exposed), I did successfully modify the Vectrosity script, which I've included below for any interested parties.  Commented lines are the original "Vector2" version of the script.

Cheers.

Code: [Select]
#pragma strict

import Vectrosity;
var segments = 16;
var lineMaterial : Material;
var radius = 2.0;

function Start () {
//var linePoints = new Vector2[segments+1];
//var line = new VectorLine("Line", linePoints, lineMaterial, 3.0, LineType.Continuous);
//line.MakeCircle (Vector2(2,0), radius);
//line.Draw();

var linePoints = new Vector3[segments+1];
var line = new VectorLine("Line", linePoints, lineMaterial, 0.5, LineType.Continuous);
line.MakeCircle (Vector3.zero, Vector3.up, radius);
line.Draw3D();
}

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly[SOLVED]
« Reply #10 on: June 19, 2013, 01:23:16 AM »
Hi,

 so... you had fun on this thread it seems  :P

 I see the problem now, yes indeed, the vectrosity actions I created are only 2d, the whole vectrosity api is not yet covered and making 3d shapes is not yet implemented, so modifying your action was the right thing to do, because internally vectrosity now knows it should be in 3d. I would however make a new action for it, like Make3dCircle or something. Share it back and I'll put it on the wiki with credits to you.

Thanks for keeping everyone updated :) it's appreciated.

bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Vectrosity Actions: Generated Shapes Not Grouped Properly[SOLVED]
« Reply #11 on: June 19, 2013, 07:05:23 AM »
Indeed, just loads of fun!  :)

I responded in the Actions forum to you other post, so no need to reiterate here, but thanks for confirming that I'm taking the right path.

Cheers