I'm having trouble with (probably) lengthdir. I spent so much time on it, but I just can't figure out what I am doing wrong.
I thought that maybe someone can give me the reason this is happening.
Basically I was trying to draw circles in front of the character, as hands and I used...
I have been making steady progress on a game I have been working on (mostly to learn) but it is an RTS style game. Most of the time I am able to debug enough to resolve my own issues, however, I am coming across a problem I cannot seem to think through on my own. Perhaps its...
when my player is at angles 0, 90, 180 or 270 the bullets look correct.
if my player is between those angles then the bullet spawns off to the right/left of where it should be.
var _xx = x + lengthdir_x(20, image_angle);
var _yy = y + lengthdir_y(0, image_angle)...
ive tried a lot of things here, but i couldnt figure it out.
im trying to have a wx and wy follow my car at a certain position with the old lengthdir method, but it only seems to get more and more out of place, the more i keep trying.
currently im using:
step event in car:
wx = x +...
Hi, my question in GML:
I want to have an object orbit or swarm around the player object once it reaches it.
My hangup is after the collision occurs would I then just use lengthdir to create the orbit? Or is there a simpler way?
GM Version: GameMaker Studio 2 (GameMaker Studio 1.4 with slight code modification addressed)
Target Platform: All
I walk you through all the steps of creating a stunning sunburst (radial pinwheel) effect in...
i even used the code from the manual and it doesnt work
/// randomly shoot
can_shoot -= 1;
xoffset = x + lengthdir_x(5, obj_rotTurret.image_angle)
yoffset = y + lengthdir_y(5, obj_rotTurret.image_angle)
//xoffset = x + cos(image_angle * pi / 180) * 5
//yoffset = y +...
OK I have trying to use lengthdir, for attaching parts to an object and keeping them in place when I rotate the object.
I thought I had this figured out. Until I began to try and align the objects and I found that the lengthdir code I have changes the x,y of the initial starting place as soon...
Hi everyone. So I've been struggling with this for the last few hours, and after failing to find a solution elsewhere, I've decided to ask here: how do I check a collision with collision_line in other directions?
Cardinal directions are easy, because it uses a rectangle, but I can't find a way...
Hello guys, first timer here :)
I'm trying to solve my issue by myself for a while now, but can't figure it out. Not enough experience yet. So, basically I have a sprite from OpenGameArt. My pivot point is in the middle of the baseball cap of that character. I've also "moved" all frames I need...
I want to make the player swing from a fixed object. I have lengthdir set up and can make them rotate around it using the D and A keys but would like to add a form of physics to the whole system. i,e: Add the speed that they're travelling in a direction to when the grab onto the object and use...
I'm trying to rotate an object's sprite around its sprite origin (which I have set to be at the center of the sprite), but after I have first re-positioned it with lengthdir.
The sprite is drawn correctly at the new location with the lengthdir functions, but the point (axis?) of...
I'm trying to have an object 'locked' to another, so when the primary object rotates the secondary object will rotate around it at a fixed distance away from the primary.
For example a rocket booster on the back of a ship. As the ship rotates the booster always stays at the back of the...
I have two objects (Wagon and Turret) and I want the turret attached to the wagon. I found out that lengthdir is the one to use for this. But I'm no programmer/scripter so who can help me out step for step.
Hi, so I've been trying to make an object_view be in the half of the distance between my object player and the nearest enemy so I can have more dynamic views. If solved I will do a max distance but that I can figure out myself.
Here's my code and it just simply doesn't work as intended on...
I am trying to add a fire animation at the tip of my gun. for this I am using an instance_create in the step event when the gun fires and used length_dir so I could measure the tip of the gun from the origin... (Gun origin was 8,14. Gun tip was 26,5... Difference brings me to 18,9).
Does anyone know how to get the x,y, of a particle burst to follow the tip of a gun. I've used this in multiple scenarios with instances, but this is the first time with particles. I've posted what I think is the relevant code below.
The x,y length_dir code I'm using shoots the flame from the...
Would a math-wiz lend some help please?
Rotating SPRITE A with image_angle, and need SPRITE B to rotate with the same angle--no problem here, but repositioning as in the supplied image... how would one go about that? I suspect some...