playMaker

Author Topic: "If" or "Compare" with Vector3 ?[SOLVED]  (Read 2092 times)

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
"If" or "Compare" with Vector3 ?[SOLVED]
« on: December 28, 2013, 10:43:15 AM »
hi there,

I have setup a scene and the Maincamera is controlled by some FSMs and Gui buttons.

If you press button "Next", the camera moves a certain amount of units in one direction (X-axis). If you press "prev", the camera moves the same amount "backwards" along the X-axis.

I set it up to act like a "slideshow" (next = camera shows next object and so on), prev is to get back to the previous object.

I got a Vector 3 variable setup at 0, 0, -100

The "next FSM" just adds +300 units on the Vector 3 x-axis, the "prev FSM" just subtracts -300 units on x-axis.

You may see the problem here, because I must make sure, that the "prev FSM" only subtracts the 300 units, if the camera´s position is not the starting-position (0,0,-100).

Basically "prev" should/must work only, if Vector 3 x-axis is >0

Is there a way to set this up in FSM-Statements? Normally, I would do a compare or and IF statement, when coding it manually - how to translate this in Playmaker FSM?

cheers!
« Last Edit: December 30, 2013, 06:55:36 AM by jeanfabre »

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: "If" or "Compare" with Vector3 ?
« Reply #1 on: December 28, 2013, 11:17:00 AM »
Hey,

you could just compare the X value instead of the hole vector (get vector3 xyz and so on)

Wouldnt it be better to move the objects and leave the cam at place? then you could easyly switch back to the first item in your list at the end and do something like a "carussel" plus you dont end up with very hight position value on your camera.

cheers
Peter

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: "If" or "Compare" with Vector3 ?
« Reply #2 on: December 28, 2013, 11:36:15 AM »
jap, got it myself, yiieehhaarr ;)

I stored the Vector 3 x into a float and compared the float to a value (less,equal,greater than...) and so on... works!