[CLOSED TOPIC] Moved to another related question

So I’ve figured out how to make my character “shoot” (emit). I know how to make my character turn around or rotate to shoot in different directions that way. But how do I make an attached weapon that moves independently from the sprite itself and shoots in the direction it’s pointing at? Like if I have a guy running around with a gun, and I need to shoot something in the sky, how do I make the gun point up at the sky without making the character itself bend awkwardly backwards?

I’m okay with either keyboard or mouse guided aiming, either one works, I just want an attached emitting weapon that moves independently of my player sprite.

For reference: I’m currently making a war game with tanks and stuff. I want their turrets to be able to point in different directions without moving / spinning the tank itself. I also want enemy soldiers to be able to point their guns at me when firing at me without the entire sprite having to rotate to face me - just the gun itself.

1 Like

Make an arm object and then you can use point at to make it aim at the mouse

3 Likes

That’s the thing, I’m not sure how to make an arm object. I’m guessing I have to make it outside of the playable screen, then attach it to the player sprite, but I’ve never done that before… and I’ll need to make it look right when it’s connected. Do you have an example I could see?

1 Like

Match orientation in the Attacher block

2 Likes

So basically I want to make the gun separately, then attach it to the sprite, correct? Then adjust it to look right from there?

And make the gun itself able to rotate, even though the sprite doesn’t rotate…?

1 Like

Yeah. Gamougg 4 and The Plorp Chronicles use entirely or partially the Attacher block for the player’s arsenal; you can check those out.

2 Likes

Cool! I tried to check out another game as an example, but I couldn’t figure out his code… it was all hidden behind bundles inside of bundles and mailbox commands, etc. :laughing:

2 Likes
2 Likes

Okay, so I made a basic turret and attached it to the vehicle, but it’s attached to the middle of the vehicle, and I want it to be on top of the vehicle. Is there a way to adjust what part of the sprite it attaches to?

b

… which would actually work fine for foot soldiers carrying guns. But it doesn’t work right for turrets that are meant to be top or bottom mounted on vehicles.

1 Like