Game maker object pickup tutorial @rexfurry
Game maker object pickup tutorial  @rexfurry
Uploaded September 2011 | Updated September 2026, 2 weeks ago
A tutorial on how to pickup and carry/throw objects in Game maker. This tutorial is intended for platform games.

Codes:
if place_meeting(x,y,obj_pickup2) //check if we're touching the pickup
{
var ID;
ID=instance_nearest(x,y,obj_pickup2); //if we are get it's ID. This allows us to have numourus
ID.stick=true; // pickups and be able to pick up the right one
}//Set stick to true, which makes obj_pickup2 stick to the player

if place_meeting(x,y,obj_pickup2) //Same as press "a"
{

var ID;
ID=instance_nearest(x,y,obj_pickup2);
ID.stick=false;
ID.speed=6; //change the speed to change how the pickup gets thrown
if right=true
ID.direction=50; //the direction in which the pickup is thrown
else
ID.direction=130;

}

solid = false;
gravity=0.2; //this is the gravity. Is the same as "Set gravity" D&D (drag and drop)
gravity_direction=270; //if you change the "gravity=0.2;", then you'll need to change all
//the things that have a *** to the new gravity
stick=false; //our variable which will control when the object stick to the player

if stick = true //if we're meant to be stick to the player...
{
x=obj_player.x; //stick to the player
y=obj_player.y;
gravity=0;
other.solid = false;
}
else
gravity=0.2; //else we set the gravity.

if stick = false // if we're not meant to be sticking to the player.
{ //If we didn't have that, all hell would break lose.
move_contact_solid(270,12); //Move to contact in GML form
speed=0; //Vertical and Horizontal speed to 0
}

And here's the link to that test video I was talking about: youtube.com/watch?v=E2-pnDfjSCU&feature=channel_video_title
Game maker object pickup tutorialGame Maker Piranha Plant TutorialFirst Anime Animation - MS PaintGame Maker - Kirby Abilities TutorialGame Maker Following Enemy TutorialCoxN Crendor in the Morning Animated - Krumel Monster RETURNS!Rexplays: Crystal Universe Aftermath - [10/11]Game Maker Custom character name - TutorialGame Maker Tutorial - Multiple save filesLets Draw in Game Maker - Light PuffGame Maker Controlled Parallax Scrolling TutorialTMF Fan Composition   A lively Town
rexfurry |

Game maker object pickup tutorial

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER