Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (JeyKey II), 13,031 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
MaliceTheMaker, Haitao_Ren, JimSimons, julienp, julienper
19248 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
moving to a certain point on the map #382517
09/08/11 22:05
09/08/11 22:05
Joined: Aug 2004
Posts: 1,305
New York
PrenceOfDarkness Offline OP
Serious User
PrenceOfDarkness  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,305
New York
I'm trying to make an object move towards the center of the map. However with the method I'm using the object's speed gets slower. Is it possible to do what I want to do with out making the object have to face the center (in other words I don't want to use entity coordinates I want to use world coordinates).

Code:
while(1){
wait(1);
vec_set(tempVec,my.x);
vec_sub(tempVec,vector(0,0,0));
		vec_mul(tempVec,vector(-1*time_step,-1*time_step,-1*time_step));

c_move(me,0,vector(tempVec[0]*0.01,tempVec[1]*0.01,tempVec[2]*0.01),IGNORE_PASSABLE | GLIDE);
}



Last edited by PrenceOfDarkness; 09/08/11 22:08.

"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
Re: moving to a certain point on the map [Re: PrenceOfDarkness] #382519
09/08/11 22:26
09/08/11 22:26
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
vec_diff(temp,nullvector,my.x); // you can copy and invert the vector my.x, too
if(vec_length(temp) > 25)
{
vec_normalize(temp,25*time_step); // 25 is your speed
c_move(me,nullvector,temp,...);
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1