playMaker

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

VascBogdan

  • Full Member
  • ***
  • Posts: 118
MoveTowards a DIRECTION, solution ?
« on: January 27, 2015, 11: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

  • Full Member
  • ***
  • Posts: 158
    • wetcircuit.com
Re: MoveTowards a DIRECTION, solution ?
« Reply #1 on: January 27, 2015, 03: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
Re: MoveTowards a DIRECTION, solution ?
« Reply #2 on: January 28, 2015, 07: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: 2511
  • Mender of the past
    • Cleverous
Re: MoveTowards a DIRECTION, solution ?
« Reply #3 on: January 28, 2015, 07: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?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Re: MoveTowards a DIRECTION, solution ?
« Reply #4 on: January 28, 2015, 09: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: 2511
  • Mender of the past
    • Cleverous
Re: MoveTowards a DIRECTION, solution ?
« Reply #5 on: January 28, 2015, 09:37:04 AM »
Translate.

Point the object in a direction, translate on Z which is the common forward direction in Unity.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

VascBogdan

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

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: MoveTowards a DIRECTION, solution ?
« Reply #7 on: January 28, 2015, 11:48:15 AM »
Z is forward, even using native 2d.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

rik

  • Full Member
  • ***
  • Posts: 246
Re: MoveTowards a DIRECTION, solution ?
« Reply #8 on: January 29, 2015, 03: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
Re: MoveTowards a DIRECTION, solution ?
« Reply #9 on: January 29, 2015, 09: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

  • Full Member
  • ***
  • Posts: 158
    • wetcircuit.com
Re: MoveTowards a DIRECTION, solution ?
« Reply #10 on: January 29, 2015, 09: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.  ::)