![]() |
movement formula for 'move' command
I've recently created a NPC that follows a certain path. The NPC uses the move command to move, so the time it takes is required. However, I can't get it to maintain a constant speed. Does anyone know a formula that can help me out? All help is appreciated.
|
The time should be something like (dx*dx + dy*dy)^0.5 / speed, I think.
|
I actually had that, except I did not divide it by the speed at the end. I'll try it. Thanks.
EDIT: Well it worked. Thanks a lot! ^^ |
1 Attachment(s)
I have attached a baddy script - it uses the move command. I made it initially for archaic, but it should help you.
But to the point: NPC Code: Edit: Then simply use NPC Code: etc. Hope It helped :cool: |
I guess a bit, but I'm only looking for an equation to put in 'time' of the move command, so that no matter the distance it moves, the walking speed remains the same. I am not using x+/x-/y+/y-.
|
try multiplying the distance by .05? dono
|
Ran into a problem. I made a npc that walks in a straight line on the along the x axis and while its moving in between the 2 points, it goes very fast. I guess the equation didn't work properly =/
Can anyone help me out with one that works? |
try somethin like this
NPC Code: |
All times are GMT +2. The time now is 10:44 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.