I’m trying to grab the spawned instance of an actor (instanced static mesh component) during run time using blueprints only and relocate it by attaching the actor to a character or character child component( referenced instanced child component?), or possibly even replace an existing child component of the character.
Can this be done?
and how do i grab that instance i cant get it to work for the life of me?
I’m using this in a scene component class to spawn an actor, keep a reference to it, and attach it to a component. Is this what you’re trying to do?
ive done the same at least 10 times over wondering why it doesnt work, the actor never moves from its spawned location. any help?
Im assuming your weapon class BP contains a skeletal mesh component.
And yes my settup has been the same several times over . i drop the spawned class ref directly into a var and pass it to attach but the bp object never moves and it makes 0 sense, Ive also tried with static meshes
Ive even checked the class against the spawned reference and returned positive results.
I need this to happen just like this, but i dont drop these items into the level before play and i dont use construction script.
I need this to attach to the player at runtime when the actor is spawned.
My weapon classes don’t have any mesh components, they’re functional only for spawning projectiles. My scene component is attached to a static mesh socket on a Pawn, then spawns an actor class and attaches the spawned actor to itself on BeginPlay. Does the class you’re trying to attach at least move when its parent moves if it doesn’t on initial attach? What are you using as the Attach Location Type?
The attach location type is a component location with a relative offset from the player pawn. I was unable to get the mesh to attach to that component. Do you have a screenshot?
What would you like a screenshot of? One of your BP and Component tab could help figure this out for you.
When you play in editor, scroll through your World Outliner tab until you find your pawn. If the attach has worked, you should see the attached actor nested under your pawn. If you’re spawning the actor just like I am (with Get World Transform) then attaching with Keep Relative Offset will give seemingly weird results; the actor’s transform is used as the relative transform to the new attach parent. If you need the actor to attach to a certain position on your pawn, you might want to use sockets.