Home   Help Search Login Register  

Author Topic: How to calculate the Velocity from object to object?  (Read 590 times)

0 Members and 1 Guest are viewing this topic.

kevind2003

  • Guest
Hi,

Please help... I want to set object A (ammo) moving to object B, how can it be done by using Velocity? I've the position and direction values of objects already. Thanks

m21man

  • Guest
Re:How to calculate the Velocity from object to object?
« Reply #1 on: 31 Dec 2003, 08:25:04 »
You want Object A to move from its position to the position of Object B?

kevind2003

  • Guest
Re:How to calculate the Velocity from object to object?
« Reply #2 on: 31 Dec 2003, 08:26:53 »
yes, please help  :)

m21man

  • Guest
Re:How to calculate the Velocity from object to object?
« Reply #3 on: 31 Dec 2003, 08:35:20 »
I'll see if I can figure it out.

RED

  • Guest
Re:How to calculate the Velocity from object to object?
« Reply #4 on: 31 Dec 2003, 09:13:44 »
Code: [Select]
_ms = 30
_velocity = [sin (getdir objectA) * _ms, cos (getdir objectA) * _ms , 0]
objectA setvelocity _velocity

ObjectA will have to be facing the direction of ObjectB for this to work. _ms is the speed in meters per second.

RED
« Last Edit: 31 Dec 2003, 09:18:52 by RED »

kevind2003

  • Guest
Re:How to calculate the Velocity from object to object?
« Reply #5 on: 31 Dec 2003, 16:36:11 »
Thank you very much  :)