Following an actor

Non-platform specific questions.

Following an actor

Postby Freddy » Sat Jul 14, 2007 5:48 pm

How do I make an actore follow another actor, only on the x axis?
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Postby pixelpoop » Sat Jul 14, 2007 6:47 pm

on the draw actor script of the one doing the following:

x=actor.x;
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby Freddy » Sat Jul 14, 2007 7:26 pm

Thanks, but how can I make my following actor travel at a certain speed?
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Postby d-soldier » Sat Jul 14, 2007 10:52 pm

Draw Actor script: Adjust the "50" to get different results: Change the "actortofollowhere" to the actor's name.

int weight = 50;
x = ((weight -1)*x + actortofollowhere.x)/weight;
y = ((weight -1)*y + actortofollowhere.y)/weight;
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Freddy » Sun Jul 15, 2007 6:14 pm

ok, i made the variable for weight and i used the code for the x axis, but no matter how i tweek it, the following actor allways wants to go to one side of the scree. :?
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Postby Freddy » Sun Jul 15, 2007 6:31 pm

Never mind!!!! :D :D :D :D
I figured it out.
Thanks soooo much
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Postby d-soldier » Sun Jul 15, 2007 6:35 pm

Good, and for future reference, no "weight" variable needs to be created.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest