answersLogoWhite

0


Best Answer

In the step event, add a move towards action and put x as object1.x. Put y as object1.y. Enter the desired speed below.

Of course, this is only an example and you would have to replace object1 (in both places) with the name of the object to be followed.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you make a object follow another object in Game Maker?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Other Math

How do you make an object follow another object in a Game Maker game?

objectfollow = name or id of object to follow. spd = speed to follow. { if collision_point(self.x,self.y,objectfollow,true,true) = false { mp_potential_step(objectfollow.x,objectfollow.y,spd,true) } }


Is there an internal variable for an object's speed in Game Maker?

Yes, the internal variable for an object's speed in Game Maker is <Object_Name>.speed.


How can you make an object follow another after a key press in Game Maker?

If you want to make an object follow another on demand (which i assume is your goal) then in the object you want, maske an action. For example - keyboard press F. In this action put what will happen.There are basically three options (although there is probably some complicated code for advanced games).1. Move TowardsX object name here.xY object name here.y2. Step TowardsX object name here.xY object name here.y3. Step AvoidingX object name here.xY object name here.yFor all of these you have to specify the speeds of the object that is moving towards the other. And there are some slight differences in each but choose one that suits your game.I hope this information was helpful.


How do you give an object a vertical speed in game maker 7?

use the action with the big up arrow


In Game Maker how do you make the screen follow more than 1 object since I made a part where your character can get in car but i have to change the speed so i change the object and it stops scrolling?

Sorry if this sounds confusing...not the best at explaining in the step event for the objects your want the camera view to follow simply put view_object=object_index that will make the camera follow the object. now when you change objects player to car. as long as your car has that in its step even the camera should follow the car because the player is gone and vise-versa. comment by Doublek642: Thanks alot man it worked perfectly for all vehicles! oh, and one more question. How do I make power-ups turn you back to normal after a certain amount of time/use? (in game maker)

Related questions

How do you make an object follow another object in a Game Maker game?

objectfollow = name or id of object to follow. spd = speed to follow. { if collision_point(self.x,self.y,objectfollow,true,true) = false { mp_potential_step(objectfollow.x,objectfollow.y,spd,true) } }


How do you change objects not sprites in game maker 7.0?

Change to another object with the same sprite


How do you make a object create behind another object in game maker?

with (instance_create(x,y,objecttobecreatedbehind)){depth = objectinfront.depth + 1;}


How do you make a object move towards another using Game Maker?

in code:move_towards_point(object.x,object.y,speed)


Is there an internal variable for an object's speed in Game Maker?

Yes, the internal variable for an object's speed in Game Maker is <Object_Name>.speed.


How do you make an object follow you and collide with you in game maker even you walk?

Whatever code you're using to make the object follow the character, place this in the step event. Then, the object will always be moving towards the other. Specifically, make it move towards point: X: character.x Y: character.y


How do you make an object act differently if it hits the side of another object insted of the top or bottom in game maker?

It's a complex question. Using math, you can determine which side it collided on.


How do you make an object pick something up in a game maker game?

Je moeder is gay.


Game Maker - How can you make an object follow another object only when both objects are in play?

when it is play, use a variable like "inplay" and set it to true. if it isn't, set "inplay" to false. so use the Test Variable action and say if inplay is equal to true, use the action to move towards the point.


How can you make an object appear on game maker in code?

use the instance_create function


What does the setting the depth to - 10 for an object do in game maker?

Depth determines whether it shows up under or below an object if an object collides with it.


What is a instance on game maker?

An instance is most commonly a [Object] placed on a [Room] -Battlemaster1