playMaker

Author Topic: Can't SET Vector3? Any ideas please people?  (Read 438 times)

NewbNinja

  • Playmaker Newbie
  • *
  • Posts: 15
Can't SET Vector3? Any ideas please people?
« on: May 28, 2022, 03:01:00 PM »
I'm trying to set a Vector3 within the c# code as follows:

// Take the random X, Y and Z value and assign to FsmVector3 and save to named variable
if (!storeResultAsVec3.IsNone)
{
    // NEITHER WORKS
    storeResultAsVec3.Value.Set(10f,12f,14f);
    storeResultAsVec3.Value.Set(x, y, z);
}

I can see the values of x,y and z have been randomised by my previous function but when I try to set them they literally show 0.  They never change.  I've went through it step by step in Visual Studio and the function just isn't setting the values.

Any ideas please?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7624
    • jinxtergames
Re: Can't SET Vector3? Any ideas please people?
« Reply #1 on: May 29, 2022, 04:39:37 PM »
Hi.

if its within a playmaker action script

then you should do this :
Code: [Select]
storeResult.Value = new Vector3(10f,12f,14f);
if from a non playmaker script, have a look here :

https://hutonggames.fogbugz.com/default.asp?W329