Projectiles spawning in world location nomatter what I do

Hello. Nomatter what I do, projectiles for my spaceship’s weapons seem to spawn at 0,0,0.

I’ve tried Self, I’ve tried getting player pawn, get actor location, use that. I’ve tried making the actor a variable. I’ve tried making a sphere to use as the location. Nomatter what I do, I can not choose the location to spawn an actor from my spaceship. I can not figure out why.

I also tried using a 3D Vector but the 3D widget wouldn’t show up in the viewport, even when I checked to show it… not sure if this is related.

I can not figure out why this won’t work and it’s driving me nuts.

My projectile is just a sphere right now, it doesn’t do anything. When I copied the First Person Shooter Projectile from the FPS template, It did the same thing, it shot forward from 0,0,0

Thanks for any help. I’m on 4.9 waiting until my bandwidth cap resets to update, if this is a 4.9 thing…

It certainly isn’t a 4.9 thing. It works just fine.

Could you for testing add a breakpoint to the “SpawnActor Projectile” node?
(If you don’t know about that yet: Blueprint Debugging | Unreal Engine Documentation)

Just check if “Get Actor Location” already returns weird stuff. It might just “Get Player Pawn” returning something weird.

On top of that there shouldn’t be a reason to try and get the character via “Get Player Pawn”.

If this is in your player controller you can do “Get Controlled Character” (this might also be “Get Controlled Pawn”. Excuse me not quite remembering this exactly. Searching “Get Controlled” will bring it up).

If this is inside of your weapon then you should spawn it from within your character and provide a reference to your weapon.

There really isn’t a place where you don’t get a proper way of accessing your player character / storing it on spawn. You always have the instigator if you use that feature and so on. “Get Player Pawn” is not actually a good way of doing things.

Cheers

Well, I tried other methods, but they all failed. What’s pictured is the last method I tried, but others didn’t work either.

This isn’t in a player controller though… I honestly don’t really know what the difference is between that and a pawn so I don’t really bother. I switch between many pawns in my game and need to have it set up so the control is on the pawn itself.

My character is the weapon in this context. The guns are on the model. So I am trying to spawn it from the character I guess. I haven’t tried making a socket yet, I guess I’ll try that… but it’d be a lot easier if I could just use 3D widgets like I usually do. I do that all the time so I don’t understand why it’s going wrong now

…then for what do you need “Get Player Character”?

That would be “Self” wouldn’t it?

Yes, that was what I started with, but it didn’t work. Since Self didn’t work, I thought, okay, let’s GAURANTEE I’m getting the pawn with Get Player Pawn, or Get Player Character. I tried everything I could think of (except sockets which I’m doing now)

Basically nothing works. I’ve done many many things trying to get the position and there’s no reason it shouldn’t be. It returns 0,0,0 as a result nomatter what (I can’t even change the position by getting 0,0,0 and adding 10,000 to it. It still goes to 0,0,0 as the final answer nomatter what)

The picture I used was a really bad example maybe because it’s a weird way to do it, but it’s only like that because that was the last thing I came up with before coming here. As far as I know Self should work. In fact, I have another Pawn where Self is working, and I can spawn stuff properly. The blueprints are even copies of each other so it’s weird. I’m thinking there’s some kind of conflict.

I might even just remake the pawn and see if that works but that seems wasteful

Finally figured this out.

I had added a Scene root to my ship, and connected the Ship model to that. However, some of my blueprints were moving the ship, but not the scene.

I solved this by simply getting the world position of my ship (mesh) instead of the actor, I could probably also fix it by tidying up my scene and triggers.