Rifle root needs to be "Rotated" to match Player Pawn

Hey Guys,

Ok.

Let me see if I can if I can explain this in a few short lines.

I have attached pictures to further show what I am facing.

Some how in the SK_Rifle_Skeleton I need to some how rotate the rifle 90 degrees so it faces front wards.

I moved the socket for the muzzle effects in the editor, and it showed up in game, but for some reason when I rotate the rifle at the root, it does not show up?

Ok Guys, What Gives?

Thanks,

Guys, ok please this has got me stuck in my tracks. How can I get past this?

I’ve attached the weapon in c ++. Some how I have to rotate this in the editor?

SO nobody knows how to fix this…

Do you have the weapon attached to a socket in your character’s skeleton?

Finally someone to my rescue, I thought surely chivalry was long dead.

Ok,

First, I am using include “GameFramework/SpringArmComponent.h”

the code snippet is:

SpringArmComp = CreateDefaultSubobject<USpringArmComponent>(TEXT(“SpringArmComp”));
SpringArmComp->bUsePawnControlRotation = true;
SpringArmComp->SetupAttachment(RootComponent);

from the Charcter.cpp file. I am not sure if the pawncontrolrotation = true is causing some issues, since I was able to move the socket for my muzzel flash effect in the editor…and it worked.

Now, in the skeleton file, in the editor the rifle root the magazine root and the socket muzzle are showing up as “moveable”.

However, I can rotate the rifle on it’s root, but it doesn’t show up as changed in “game”

Is the code keeping it from rotating in game?

This is the Blueprint part of the forum so I’m unsure it’s the right place to ask such a question.

I’m having trouble understanding your question / problem.

From what I see in the screenshot, the Skeletal Mesh Component “Rifle” is attached to the root of your Skeletal Mesh Component “Third Person Character” (and it seems to have a relative rotation as well).

You want to attach it to a socket of the Mesh (you can do this in CPP or Blueprint). You want to setup the socket in the Skeleton pannel of your Third Person Character skeletal mesh asset. You can rotate it here freely (and you can preview how it look like when attaching the rifle by right clicking your socket and adding a preview asset).

If you want to directly edit the Rifle in the Blueprint panel, you need to add “BlueprintReadWrite” to the component declaration of the Rifle (or something of the sort, I’m not a CPP expert).

Add a socket to the skeleton in the skeleton asset and rotate that instead
attach the rifle to the socket

Ok,I think I am going to back track the lesson. I might have done something wrong. He first adds a box instead of the sk_rifle. Perhaps either I missed some code or the ik_hand in the skeleton file is pointing the wrong direction.

Thanks for the feedback.

I will try this since it might be the issue. I am going to back track the lesson since that might what I missed.

thanks for the feedback.

a side not that I have to say. When my visual assist trail up I was like ok…no worries, I can spare 20 bucks or so…but then I got it the page where it says…oh by the way visual assist is 99 dollars…i was like NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

Ok, Guys I fixed it, or just about. The way to fix something like this is to open up the (UE4_Mannequin_Skeleton) and then rotate the “weapon socket” that I attached the Rifle mesh.