Generating SceneComponent via blueprint during runtime

Hi Sorensor,

I think the node you are looking for is “Spawn Actor From Class”, and if you want to make some collectable coins in the scene dynamically, you can randomly choose some spawn points’ transform to do so.

And the detailed solution is in the Epic’s Official Tutorial “Endless Runner”, hope that will help:

Cheers

I’m having trouble figuring out how to spawn SceneComponents during runtime via blueprints. It looks like there are many solutions for doing this via C++ but I’d rather stick to blueprints for now.

I’m trying to create a grid for a variable sized area. I want to use SceneComponents as attachment points for the grid. Is this possible or would I be better off just using Actors or something?

Thanks Jack,

Although I don’t think that’s what I’m looking for. I can only spawn Actors via “Spawn Actor From Class”, if possible I’d prefer to just have SceneComponents as from what I understand, they have less overhead (Though I’m pretty new to UE so I’m not 100% certain when to use which object type).

Hi Sorensor,

--------------------------------------UPDATE-----------------------------------------

Finally i think AddComponent node can do the trick.

1, i created a scene component bp and bind some events into the eventdispatcher.

2, i created an actor bp and use Add Component node, and call the beginning function after return value.

3, put it into the scene and hit play.

it seemed to work properly. or you can directly write logic after Event BeginPlay in your SceneComponent, and it will work either.


(LEGACY: The node “Construct Object From Class” DIDN’T work for me, still trying to figure this out though.’)

Somehow i didn’t see your reply until today.

However, after digging a little bit into the problem, i think the node you want for creating an scene component via blueprint might possibly be “Construct Object From Class”, which is basically very similar to “Spawn Actor From Class”, except the former one can spawn a “UObject” rather than just Actor, which i believe is the lowest type of class you can create.

BTW, maybe you can describe about what function or features you want to achieve so that there might be better solutions other than spawn scene components.

I’m currently not near my computer, so i cannot test it for you. But i’ll do that hours later, and if i found something interesting, i’ll update here. Hope that will help.

Cheers