How to spawn actors along spline in construction script (Waypoint for Racetrack)

That’s right, you can’t spawn in construction. But you can put an editor mode custom event in your event graph, which can be called whilst in editor.

So you manipulate your spline, and when you’re ready, hit the generate button:

311763-editor-mode.jpg

OR:

311752-child.jpg

1 Like

Thank’s for your reply.
So if i understand correctly i can basically do what i planned on doing in the constrution script, in the event graph using a custom event as trigger.
Nice! Thank you very much!

Yes either it turns out. You can add a child in contruction:

EDIT: Watch out though, the child method leaves them inside the spline BP. Not much use to use perhaps. Better to so the construction with children first, then have an editor mode button to convert them to actual blueprints ( just loop through and destory the child components replacing them with your actual BP in the world ).

3 Likes

Hi, i have a Spline actor in my lvl. I’ve made a Waypoint Gate actor (since i need logic to know when the player has gone trough), and i’ve made a Waypoint Generator actor.

I’m trying to use the Waypoint Generator to spawn Waypoint Gates along the Spline actor procedurally, so that i can modify the spline in the editor and auto generate Waypoint Gates along it. I’ve found tutorial on how to do this with static meshes, but obviously i need more than just static meshes along the spline.

This is one of the tutorial i’ve watched: Unreal Engine 4 Road Tool in Blueprints with Spline and SplineMesh - Part 2 SplineComponents - YouTube

I’m fairly new to unreal, but i understand i’m probably going about this all wrong. I’ve seen posts talking about the fact that the construction script is reused every time you change anything about the actor so you can’t spawn actors with it. But i don’t understand what i’m supposed to do instead.

Thank’s for any reply and taking the time to read my question.

Ps: I’ve tried to be clear about my situation, but i speak french (Belgian) so feel free to ask me for any precision. And sorry if this has already been answered somewhere, but i looked and didn’t find anything. I also don’t really know the terminology i should be looking for… so there’s that :slight_smile:

Thank’s

oh, so you can do it by adding a child. But do you need the actor in the level to add it as a child or is it like “spawning” an actor?

ok sorry i understand, It’s a child of the gate inside the gate actor. So you need the gate actor in the lvl.

Yes, you just though of it too :slight_smile: - see above.

is there any way to spawn actors inside the Spline area?
like lets say we make a area and connected the splines start point and end point so can we spawn inside the Spline area?