While I didn’t use TSubClassOf for some reason I couldn’t set my weapons in blueprints.
So I wish to know is it any ways to escape two additional class fields and still be able to set my weapon in blueprints and have access to them in cpp class.
Even batter if I will can see my LeftHandWeapon and RightHandWeapon right in class components.
For you WeaponComponents to show up in the left hand side field (Where the other components are), make sure to have it derive from UActorComponent.
You have to create the Component in the constructor and set the weapon it should represent somewhere else (BeginPlay, PostInitProperties, or any function where you want your weapons to be “shown”). You can use the TSubclassOf for the variables which store the type of weapon that should be represented, which I assume is what you are trying to do already.
It probably isn’t showing your components, because you didn’t initialize them in the constructor:
There’s a function for exactly your use case actually:
Yep, I know. But if I change to EditAnewhere I still can’t do this.
There is simply no way to select the desired class. For some reason, the map is only in the dropdown list
The problem is you want to set an object (actor) of a subclass of AWeaponActor. You’d have to specify the blueprint class, but I’m not sure how. I think there was a way to solve your problem, I’ll have to dig a bit, but I’ll let you know if I figure it out.