When I try to set a weapon in my enemy character BP, my weapon blueprints doesn’t show up in dropdown, they only show up if I drag them into the level but even then selecting them doesn’t work/do anything. What am I doing wrong?
Kehel18 has the right idea. Alternatively if your weapons are derived from the Actor class you can replace “class AMyWeaponBase* EnemyWeapon;” with AActor* EnemyWeaponActor; and cast it to AMyWeaponBase. You can do this being that all of your classes are derived from AActor.
Hello! The form that you are using allows only Actor to choose, so you can set to this property only Actors of class AMyWeaponBase from some Level. Maybe it will be useful for you to use
I couldn’t figure out how to use “EnemySkeletalMeshComponent” in my code.
I’m using the same AttachToComponent() line with GetMesh() in my player character class, it works just fine. There I’m equipping overlapped weapons and switching between weapons all with AttachToComponent(). Here I’m trying to assign/equip with only one specific weapon to the my enemy character.
I moved the code from constructor to BeginPlay() for now cos sometimes things doesn’t work in constructor. If I use anything other than TSubclassOF, weapon blueprints doesn’t show up on my enemy character in dropdown. After fixing editor’s crashing with checking if Weapon is valid after Casting, I think casting doesn’t work somehow.
Are Skeletons are the same? Sockets are stored in Skeleton asset, so if enemy has another skeleton, socket should be created in it either. Also check Mobility for Weapon actor and take a look at Unreal logs, perhaps they help to find the problem…
Different Skeletons. I created a new slot with the same name in the enemy characters’s skeleton. You reminded me to add ignore collision and stop rotating lines after equipping but adding them didn’t help either.
Only things skeleton related I could see in the logs were some warnings for SocketNames on my player character, nothing for the enemy.
Tried debugging the Cast line, it says: “error = parent failed to evaluate: variable not available”
: