playMaker

Author Topic: Vector3 Rotate Towards doesn't work[SOLVED]  (Read 2359 times)

kute

  • Playmaker Newbie
  • *
  • Posts: 3
Vector3 Rotate Towards doesn't work[SOLVED]
« on: March 09, 2017, 10:02:00 AM »
Hi guys,
I am wondering why Vector3RotateTowards doesn't work.
I want to open a box using Vector3 Rotate Toward.

here is what I did;
  • I made a new empty object to move a pivot
  • The object had a 3d cube child as lid of box.
  • I attached the state with action 'Vector3RotateToward'
  • I set target values with some values. I set source values with 0

When I ran the event, the values in fsm editor are changed.
However, the transform of the cube in inspector, is not changed at all.

Am I missing something?
Please help me.
Thanks.
« Last Edit: March 11, 2017, 02:23:58 AM by jeanfabre »

zombie

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Vector3 Rotate Towards doesn't work
« Reply #1 on: March 09, 2017, 06:35:26 PM »
I struggled with that myself. I can do it in a couple of lines of c#, but Playmaker makes things absurdly cumbersome. I was never able to figure out how to use Time.DeltaTime, so I just gave up and used code to do effectively the same thing.

I'm personally starting to think that Playmaker is worthless.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Vector3 Rotate Towards doesn't work
« Reply #2 on: March 10, 2017, 01:25:35 AM »
Hi,

 I think you are getting confused with many different concepts.

 Vector3RotateTowards works, but in your case, you might want to control the quaternion rotation instead really.

As for Time.DeltaTime, this is also working very well, but you need to understand the concepts behind PlayMaker Finite State Machine, what a state is, how actions are executed and when, which then will allow you to use DeltaTime properly within PlayMaker.

PlayMaker is a shift of paradigm, it's a Finite State Machine system, so you need to understand that before using PlayMaker, it's very important, it's not a one to one comparion with conventional c# script, it's a different approach.


If you keep struggle with opening your box, I'll do a quick sample to show you.

 Bye,

 Jean

kute

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Vector3 Rotate Towards doesn't work
« Reply #3 on: March 10, 2017, 11:40:37 AM »
Hello Jean,
Could you show me a quick sample "how to use vector3rotatetowards?"
I'm still having same issue.
Thanks.

zombie

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Vector3 Rotate Towards doesn't work
« Reply #4 on: March 10, 2017, 04:17:13 PM »
You should try itween. It took about 5 minutes to get a door to open and then close based on trigger states. And I did it using only two states, though I think I will have to add another one to deal with the possibility of the door being locked. Its as easy to rotate something with it as rotate towards is in c#.

It looks like doing things manually with quaternions and vectors is best left to c# scripts.

kute

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Vector3 Rotate Towards doesn't work
« Reply #5 on: March 10, 2017, 11:36:42 PM »
Hey Zombie,
Thank you to mention itween. The itween action is working perfectly!
itween can replace v3rotatetowards.