playMaker

Author Topic: Creating an Object. Vector 2 variable quesiton  (Read 1787 times)

FrankDePaul

  • Playmaker Newbie
  • *
  • Posts: 25
Creating an Object. Vector 2 variable quesiton
« on: March 30, 2015, 03:44:11 PM »
I was wondering if someone could point me in the right direction. I have created 2 Arrays.

My 1st array is an array of objects. I have an FSM that has a variable called Object. It randomly selects an object from the array and stores it in the Object variable.

My second array is an array of vector2 positions. They are all different. When the random object is selected, I also randomly select a vector2 and store it in a vector 2 variable called Positions.

I then go to Create Object. I use the dropdown and see the options for "Object" variable. This works fine. It is random every time. When I go to select the Spawn Point, I would assume I would see my vector2 "Postions" variable as an option. I do not. All I see in positions is the options for Object variables.

Any advice would be great.

TheBadFeeling

  • Junior Playmaker
  • **
  • Posts: 66
Re: Creating an Object. Vector 2 variable quesiton
« Reply #1 on: March 30, 2015, 04:06:25 PM »
I believe you need a vector3 (or the location of another object) to spawn a new object.
Convert your vector2 from the array to vector3 (or simply populate your array with vector3s instead).
Jean made an action for converting 2s to 3s some time ago: http://hutonggames.com/playmakerforum/index.php?topic=2894.0

/Bad
The Force is with you, young Playmaker – but you are not a C# senpai yet.

FrankDePaul

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Creating an Object. Vector 2 variable quesiton
« Reply #2 on: March 30, 2015, 04:25:01 PM »
Thanks for the tip Bad. I think the problem is with the array reference. I typed it exactly the same but it was not recognizing it. I did it several times to duplicate the issue. The random positions would not work.

After messing around, I did a copy and paste and it works fine. For some reason it does not like when I type the reference to the array.

Strange.