playMaker

Author Topic: MoveTowards a DIRECTION, solution ?  (Read 1688 times)

VascBogdan

  • Full Member
  • ***
  • Posts: 118
    • View Profile
MoveTowards a DIRECTION, solution ?
« on: January 27, 2015, 09:53:56 AM »
When applying Move Towards action, the object moves to a target location. Is there a way to extend the path for a certain distance ?

For example, a bullet. It will movetowards the direction of clicked position. What I want to do is almost the same as this.

wetcircuit

  • Playmaker Newbie
  • *
  • Posts: 46
    • View Profile
    • wetcircuit.com
Re: MoveTowards a DIRECTION, solution ?
« Reply #1 on: January 27, 2015, 01:48:58 PM »
Try ADD FORCE... for turns try ADD TORQUE.... I have the same requirement and found an earlier discussion on this.... I haven't tried it yet so I do not know the pitfalls....

VascBogdan

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: MoveTowards a DIRECTION, solution ?
« Reply #2 on: January 28, 2015, 05:49:28 AM »
I don't think it's Ok to do this. I still wait for someone who knows how to solve this.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: MoveTowards a DIRECTION, solution ?
« Reply #3 on: January 28, 2015, 05:55:12 AM »
Why not start moving it in a direction to begin with so you don't have to use an action that is designed to move something to a specific position at a specific rate?

VascBogdan

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: MoveTowards a DIRECTION, solution ?
« Reply #4 on: January 28, 2015, 07:14:06 AM »
But how can I start moving it in a direction ? This is what I want, but I don't see an Action for that.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: MoveTowards a DIRECTION, solution ?
« Reply #5 on: January 28, 2015, 07:37:04 AM »
Translate.

Point the object in a direction, translate on Z which is the common forward direction in Unity.

VascBogdan

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: MoveTowards a DIRECTION, solution ?
« Reply #6 on: January 28, 2015, 09:45:28 AM »
My game is in 2D, so I should get the X right ?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: MoveTowards a DIRECTION, solution ?
« Reply #7 on: January 28, 2015, 09:48:15 AM »
Z is forward, even using native 2d.

rik

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: MoveTowards a DIRECTION, solution ?
« Reply #8 on: January 29, 2015, 01:53:26 AM »
Hi do you want to fire a game object for a point where you clicked ?

then you can use itween move to

VascBogdan

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: MoveTowards a DIRECTION, solution ?
« Reply #9 on: January 29, 2015, 07:02:54 AM »
Hi. Well, it should go in the direction of a point, but it should exceed it. I am now trying with the Translate and the Force things. If you have a better ideea please leave a reply. Thank you.

wetcircuit

  • Playmaker Newbie
  • *
  • Posts: 46
    • View Profile
    • wetcircuit.com
Re: MoveTowards a DIRECTION, solution ?
« Reply #10 on: January 29, 2015, 07:58:59 AM »
I don't think it's Ok to do this. I still wait for someone who knows how to solve this.
You're welcome.  ::)