playMaker

Author Topic: Question - Move Towards action only moves object once?  (Read 1657 times)

Narrows

  • Playmaker Newbie
  • *
  • Posts: 6
Question - Move Towards action only moves object once?
« on: October 24, 2018, 11:58:01 PM »
Video Link of Issue: https://imgur.com/DO9Jb1x

Screenshots of FSMs and Object FSM & Inspector Window:
PlayerObject FSM & Inspector: https://imgur.com/wwMqm7g
GetMousePosition FSM: https://imgur.com/R6lQLMv
ConvertToVector3 FSM: https://imgur.com/qxXQapz

Hello! New to playmaker/unity. Having a weird issue with a Game Object that I want to constantly be moving towards the mouse XY coordinates - like an air hockey paddle in your hand!

The Object seems to receive the XY coordinates just fine and move there once, but then it just stops and faces the mouse, no more movement.

Yes, I have the Move Towards action set to have no Finish Distance.

Having trouble figuring out what's going wrong here, any advice would be most appreciated!!
« Last Edit: October 25, 2018, 09:30:08 PM by Narrows »

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
Re: Question - Move Towards action only moves object once?
« Reply #1 on: October 25, 2018, 06:36:14 AM »
Are you sure it's actually getting the mouse coord in the first place? It looks like it just moves towards 0,0 (middle screen) and not the actual mouse.

Keep an eye on the variable while you run the game to see what is going on. If you want best possible help you should screengrab your FSM's and game object's inspector.

Narrows

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Question - Move Towards action only moves object once?
« Reply #2 on: October 25, 2018, 09:27:35 PM »
Are you sure it's actually getting the mouse coord in the first place? It looks like it just moves towards 0,0 (middle screen) and not the actual mouse.

Keep an eye on the variable while you run the game to see what is going on. If you want best possible help you should screengrab your FSM's and game object's inspector.

Thanks for the reply! When the game is running I do see the Move Towards action's target position XY change according to the actual mouse XY, but it only moves the once and wiggles in place after that. I did grab screenshots of all FSMs and the game object's FSM & Inspector window, see my updated original post.

I'm sure its some small dumb thing I'm forgetting :P

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Question - Move Towards action only moves object once?
« Reply #3 on: October 27, 2018, 03:21:28 AM »
So you got a few things going against you that I can tell in there.  Your Get X and Y are Normalized.  That means you will get a value between 1 (one side of the screen) to 0 (other side of the screen) hence your ball only moving small bits.  Even if you uncheck the normalized boxes, it can get a bit messy too.

What I'd suggest is to only use 1 FSM on that ball you want to move.  Use a Mouse Pick action on it and use the Store Point variable.  Then you can use your move towards action right underneath and set the location as the variable you just set in the previous action.  Just set the mouse pick to go every frame and it should work like that. 

You may have to place a layer on the mouse pick to only use the table so the ball doesn't float upwards once it reaches the mouse.

Narrows

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Question - Move Towards action only moves object once?
« Reply #4 on: October 29, 2018, 08:46:18 PM »
So you got a few things going against you that I can tell in there.  Your Get X and Y are Normalized.  That means you will get a value between 1 (one side of the screen) to 0 (other side of the screen) hence your ball only moving small bits.  Even if you uncheck the normalized boxes, it can get a bit messy too.

What I'd suggest is to only use 1 FSM on that ball you want to move.  Use a Mouse Pick action on it and use the Store Point variable.  Then you can use your move towards action right underneath and set the location as the variable you just set in the previous action.  Just set the mouse pick to go every frame and it should work like that. 

You may have to place a layer on the mouse pick to only use the table so the ball doesn't float upwards once it reaches the mouse.

This is super helpful, thank you so much. I'll try these suggestions and report back with the results.