Download

casting to a weapon.

I’ve been reading up on this and just cant seem to get a basic debug version work without any weapon selection.

I have a BP of the revolver that floats/rotates. When you overlay it is destroyed, it sets the revolver as owned (strings show this variable works) and it appears in the character’s socket.

Now I have the following blue print shown, trying to cause the right joystick to send a custom even to the revolver which should make the bullet spawn. Bullet works well (just had it spawn from the look controls not pictured to test it out)
The revolver has a scene component “barrel” to target for the transformation which i can target…

Just seems I cant get the right object in the cast to to cause the event to fire. I assume it’s some problem with how the bp becomes socketed to the character pawn. I tried doing get actors, but it says the BP doesnt inheriet from actor class (it says actor in top right i double checked to make sure i had not miss selected at BP creation).
I am completely lost at this point and would appreciate input.

(movement based actor is currently in there cause I had reached the just try them all step of the process)

edit:just tested the spawn by putting it to always spawn and making it activate on key press…nothing happens. So the weapon blue print accepts no control input what so ever. How do i fix that?

I had a similar problem a while back. Try putting the fire custom event behind a branch node and then set the boolean to true using the cast node. Also, make sure the object is activated and using the debug options for the event graphs, that its still executing and what its doing internally. Really for actually triggering events though, you should be using an event dispatcher from the character that’s possessed sending to the weapon assigned as child object.

O_o
Oh…yeah…
This is my first project, been learning as I go using tutorials (which it turns out basically never work right any way for some reason).
I’ll try the branch node as I completely understood that part.

Had managed to forget the debug option to watch the control flow, got in such a habbit of throwing “print string” in places to check vaules/activation (even put a text box in Hudson I could just retarget on the fly to see if values change without doing anything new).

If (when) that doesn’t work I’ll read up on event dispatcher, thank you.

I have a feeling more is wrong than I thought. Just setting the weapon to “input keyboard f” pressing “f” doesn’t do anything. So it’s not accepting ANY inputs even from when the input exsist solely there… Last think I was looking into was player controller info again to see if I needed to assign it to the weapon also…

got the weapon firing. Had to set it to accept input from player controller. Go figure it was disabled automatically. It’s little things like that, that seem get me caught up more than anything. Now I need to set up the bullet (as the mesh i made is actually bullet shaped rather than just a sphere for whatever reason i did that) so that it has proper rotation when fired…particle effect i’m using right now is too big and could be reduced…
Then onto vapor trails…phew