How to connect spline tiles in array?

Hi! I want to create an endless tiling system with splines, but I can’t figure out how to connect the end spline from the first array element to the start spline from the second, and that 10 times.

Tile Actor


GameMode


What can i do?

Thanks, but that’s not what I want, I just want to connect an existing spline from one actor to another. The end spline from first actor to the start spline from the second, and this for 10 times.
I don’t want to create actors along a spline

i don’t get much of the idea.do you mind if you draw a picture showing what they look at the end they connecting together…

1 Like

Sure!
In each BP_Tile there are two splines (Start_Spline, End_Spline)


1 Like

Do they must have 2 splines?because I think we could achieve the connection with only one spline…

Why? It’s like assigning an actor variable to another. Think as if an actor has 2 variables and you want to set the first variable from the second actor to the second from the first actor.
I know it’s possible but I don’t know exactly how to arrange the nodes. I think it’s something related to the ‘for each loop’. some scheme

I know,I mean the spline already had a start point and end point.now you have two spline component in one actor.there’s a node called ’set spline point to location’.we can use it to set end point to another actor directly.

1 Like

ok, but let’s think only about the variables, let’s exclude the spleens. If I have an actor with two actor variables named start_var and end_var, how can I set the end_var variable from the first actor to the start_var from the second actor following my schema?

1 Like

You do not even need to do it:

Store the 2nd spline’s end point location here after spawning; when you spawn another actor feed it the location so it can set the 1st spline’s point using that vector.

I made a mistake, there will be no splines, there will be an actor that contains a spline (BP_Spline) and an actor (BP_Tile) that will contain BP_Spline_01 and 02. But we exclude that, we only think about variables… So I only need to know how to set End_SplineVar from BP_Tile_01 with Start_SplineVar from BP_Tile_02 and so on, 10 times. Both variables are of actor type.

BP_Tile

GameMode

Expose a variable on spawn of whatever type you desire and feed it to the actor as you spawn it.

1 Like

I know that, what I don’t know is how to translate it into blueprints:))

  • create a variable of the desired type in the actor you’re spawning
  • flag it as Instance Editable and Expose on Spawn
  • you’ll see a new pin on the Spawn Actor from Class node
  • when spawning actors, store the desired variable
  • feed it to the newly spawned actor
2 Likes

i suggest don’t stick on communacating with two actors.that makes things more complicated ,because we have to figure out how to deal with the first spawned and last spawned actor.they can only connect to 1 single actor. if we use only one single spline,that way we can only consider connecting to last actor,or next actor.

is this similar to it?here every actor has a spline component connecting to another one.


here is the BP.



2 Likes

NextActor (end_var) is the same as Self (start_var) in the newly spawned actor:

The chain can be navigated like this from any of the actors:


The cast in the start search is in case the first node is owned by another class (player, actor in level, etc).

2 Likes

So. To be more specific. I have a cart with logic that allows it to transfer from one spline to another.

BP_Rail:

Here the important variable is Forward_M.


These are for BP_Cart to get the references.

BP_Cart:

The BP_Cart needs BP_Rail reference to function and transfer rails/splines.


The logic for transferring from one spline to another. When the cart reaches the end point of the spline, then it will pass to the next one from the starting point of it.

BP_Tile:

Here are two child actors with BP_Rail as children.



Two connected BP_Rail actors for BP_Cart to transfer them and the cart colliding logic.

GameMode:


Here is the problem, if I put 1 in Tile_Index, BP_Cart will go like this: https://youtu.be/WuLbIp-w5Sg


If I put 10, BP_Cart will go like this: https://youtu.be/UoezqSs7XlA

How can i do no matter what number the Tile_Index will be, BP_Cart will always transfer to the next BP_Tile and so on. So, how should i do this?
This part I feel is the problem and I can’t do it at all… :frowning:

Thanks to those who tried to help me. I hope I gave a lot of details this time.

IMO might be easier to use the spline length to know when to spawn:

Rail bp
  • EDIT: moved everything to the pawn.
Pawn


3 Likes

Thank you very much for your help everyone. I appreciate a lot!
I finally succeeded, that’s it. I felt it was something related to For Each Loop section.

1 Like