March 9, 2023, 3:42am
So I’m building a top-down shooter, but I want the top of the sprite to be connected to another one. This is so the entire sprite doesn’t hit a wall and only the bottom half.
To do that I want it to follow the position of the bottom and stay above it. The thing is I don’t know how to do that and I want to keep it in blocks. Any help?
spriteA.x = spriteB.x ( + xOffset )
spriteA.y = spriteB.y ( + yOffset )
This situation kind of depends on how you are using the sprite! My solution would be to have a forever block that sets the top sprite’s position to just above the bottom one’s, but depending on how you want the two pieces to behave, that might not work.
March 9, 2023, 4:23pm
you could use set x and y blocks
heres a example of how you could do this
March 9, 2023, 5:53pm
So I used your code and it worked but it would glitch back and forth when you hit a wall.
Any idea for what happening here?
March 9, 2023, 7:45pm
no sorry, could you send a link to the game i could try find out
March 10, 2023, 4:54am
got it fixed. I just had the position set to 0,0 on a loop.
March 10, 2023, 5:47pm
ohh okay good job, sorry i was offline and did not see the link so i couldn’t help
I don’t think you fixed it properly. I walked under a tile that was lower than the robot. Then the robot got kinda squished
It’s kinda hard to see on the picture
Just test it for yourself