How I get the transform:
And yet the bullet doesn’t fire from the socket (watch the left screen):
I first tried to get the attached gun’s transforms (which was attached to GunSocket) but it had the same result. But getting the socket’s transform makes me think it’s the socket’s fault. If it matters I’m using a dedicated server, but I can’t see how the transforms would be different from server to client.
Hey, why don’t you just create a socket for a pistol itself, and made a projectiles spawn there?
Also these few images are too little for anyone to help you. Can you post whole firing related logic you have done so far?
That’s what I did. I have a gun socket and I attached the pistol actor to it.
Why would you need the firing logic? It creates the bullet - it’s just the socket’s transform is wrong. Spawning the bullet from the socket itself and not the actor should prove that, no?
Inside character class:
Method Fire from GunActor class:
Only thing that happens inside BulletActor:
You have created the socket for the gun to be attached to. But I mean creating another socket for bullet to spawn so you dont need to use any “Get Socket xxxxx”. I cannot realy tell since I can’t see whole blueprint editor, but I guess your pistol is just static mesh right. So open that up, and create socket at the end of the barrel of the pistol, or inside of it. So you can just spawn bullet at that socket. Check out this tut, it is about tank creation but there is also part about firing. Blueprint Creating a Tank | Live Training | Unreal Engine - YouTube . I am still not sure if I understand the situation but give it a try.
“I cannot realy tell since I can’t see whole blueprint editor, but I guess your pistol is just static mesh right.”
No… It’s an actor. If you look closely at the first picture you can see the gun mesh is “preview only.” I only added the mesh in that picture to show thr socket’s transforms are correct. Theforth picture shows “GunActor”. I need to use actors so I have the option to change weapons. Why would I limit myself to one gun?
Like I said, the problem is the socket’s transform. It has nothing to do with the gun. I’m getting the transform directly from the socket.
“So you can just spawn bullet at that socket.”
That’s what I’m doing. Look at the second picture.
I understand what you are trying to do, but you don’t understand what I am trying to tell you. Actor is just static mesh placed in the level. I know it does not work but even if it does you would only spawn bullet where your hands are holding the gun. Create a socket for the actor. Not for the pawn. You get it? So you can then change in blueprints the target from “Mesh” to your pistol, and there will be the socket. Really you should check that video I sent you link to. From 2:20 to 2:40. It is what I mean. Now you have only socket on your skeletal mesh. If you don’t understand this I cannot help you any further.