playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - DarnVisages

Pages: [1]
1
I initially posted this as a help topic here:
https://hutonggames.com/playmakerforum/index.php?topic=20927.0

After looking into it further, I believe there is a bug in the code for the "Smooth Look At 2D" action.

If a Finish Event is set, the event is called before getting below the Finish Tolerance.

These lines are in the script (starting at line 142):
Code: [Select]
//var targetDir = lookAtPos - go.transform.position;
//var angle = Vector3.Angle(targetDir, go.transform.right) - rotationOffset.Value;
var angle = Vector3.Angle(desiredRotation.eulerAngles,lastRotation.eulerAngles);

If I log the 'angle' variable to the console, it's always 0, no matter what. But when I un-commented the first two lines and commented the third line, the action began functioning correctly and giving the correct delta angle, and then correctly exiting with the Finish Event at the right time.

Please let me know if any more info is needed.

Thanks.

2
PlayMaker Help / Smooth Look At 2D bug?
« on: August 07, 2019, 08:30:52 PM »
Hi,

I'm new to Playmaker, so I hope this is just user error.  When I set up a state with the "Smooth Look At 2D" action, my GameObject starts to toward the target object briefly, but stops after maybe a frame, before reaching the correct rotation.

I have the Finish Tolerance set at 1 degree, and have assigned a Finish Event, but it is launching the finish event way before it ever reaches the correct look vector.

If I clear the Finish Event to none, the state will complete the full rotation until it is looking the correct direction, but never exits (just continues to keep looking at the target object, while it moves or not).  But then I have no way to make it exit.

Please let me know if I'm missing something or misunderstanding how to use the Finish Tolerance/Event.

Thanks!

EDIT:  Here's a video where I'm demonstrating the issue. I'm trying to get it to do the smooth-look back and forth between two objects:
https://drive.google.com/open?id=1w2b6Huk-qnWSxc-Rzcnjwblkk4GFtuWC

Pages: [1]