playMaker

Author Topic: Move Towards a dynamic target (moving game object)  (Read 2826 times)

tttlllrrr

  • Playmaker Newbie
  • *
  • Posts: 6
Move Towards a dynamic target (moving game object)
« on: August 16, 2015, 02:13:12 PM »
I have a UFO that I want to move toward a house using Move Towards... the house starts floating when certain conditions are met. But when the house starts floating, the UFO doesn't follow it!

I've used Move Towards to make the UFO follow the player and it worked well, so I'm not sure why it is seemingly behaving inconsistently? I was having a problem earlier also where they were moving towards a distant point in the sky for no apparent reason.

If anyone can help me understand Move Towards better I'd appreciate it, thanks!

Arnoob

  • Junior Playmaker
  • **
  • Posts: 63
Re: Move Towards a dynamic target (moving game object)
« Reply #1 on: August 18, 2015, 07:46:46 PM »
Hello tttlllrrr!

How did you make the house moving? (it might be the source of the problem)

tttlllrrr

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Move Towards a dynamic target (moving game object)
« Reply #2 on: August 28, 2015, 02:43:51 PM »
I used add force every frame

Justin

  • Junior Playmaker
  • **
  • Posts: 58
Re: Move Towards a dynamic target (moving game object)
« Reply #3 on: August 30, 2015, 03:01:06 AM »
I'm not 100% sure that this is what you want. I'm away from my work computer so I can't test it, but I would try something like this...

when the house starts moving --

get position every frame, store it in a global vector 3 variable.
(If you have to create a second fsm on the house that is always getting the position everyframe once the house starts moving, or make sure you have the get position action happening in every state in your FSM that is moving the house.)

on the ufo --

move towards the global vector 3 every frame

tttlllrrr

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Move Towards a dynamic target (moving game object)
« Reply #4 on: September 11, 2015, 03:29:33 PM »
Thanks that worked!

tttlllrrr

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Move Towards a dynamic target (moving game object)
« Reply #5 on: September 11, 2015, 03:30:43 PM »
I'm having another move towards problem though now. I tell an object to move towards a position (no game object selected). It does it, finishes and transitions to the next state where i have another move towards a position. It moves to that position but never finishes / transitions! So weird.

******

nevermind, figured it out. User error. I had 2 conflicting move FSMs on the same guy.
« Last Edit: September 11, 2015, 03:40:15 PM by tttlllrrr »