Skip to main content
GameDev.net gamedev.net
🔒 Locked

Simple unit movement? is it simple?

Started by TrileNOB Apr 3, 2002 at 8:09 AM 0 replies 700+ views
Original Post
TrileNOB
TrileNOB
hello, i used pickedx() and pickedz() to give to the unit destx and destz coords (i''ll add y coord. later). But code is working just for the ''first screen''. When I move the camera unit just stops... or jumps/slides only on one axis. Help please! For units.unit = Each unit If units\destx <> EntityX(units\entity) And units\destz <> EntityZ(units\entity) Then m = units\destx - EntityX(units\entity) n = units\destz - EntityZ(units\entity) ;''I choosed 1 only for testing, this will be changed later! speed = 1 units\movex = (m/Abs(m))*speed units\movez = (n/Abs(n))*speed If units\movex > m Then units\movex = m If units\movez > n Then units\movez = n MoveEntity units\entity, units\movex,0,units\movez EndIf Next Trile[NOB]
Trile[NOB]
peous
peous
Please format your code using
[CODE]
Code button
[/CODE]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.