Hi. I hope someone can help. I am really new to this and have got stuck., so apologies if I use the wrong terms etc.
I am creating a workout game for swimmers. The idea is the character moves up and down the spline and goes faster or slower based on how hard the user is working.
I have created the spline and when I put my character (Male Swimmer) in the level I can get him to swim up and down the spline. However, I have now started to create a character select screen where you can select a female or a male and have them spawn into the level, but when I spawn them in, I can’t seem to assign the spline variable to the character. When I just put the character into the level, I can do that in the Details Tab, but I was wondering if you can do it in the level blueprint when the level starts?
Also, the Spline is used to calculate the distance and keeps coming back with an error. I’m sure if I can just sort the Spline bit out the error will be resolved.
I hope that makes sense.
Try choosing a class from the dropdown here instead. Seeing how you spawn an actor later, there may be no Actor of Class to get at this point.
Besides that, explain how the spline works.
Why are we doing this? You have a spline actor with a spline component, sure. But how does this actor know what Spline actor is. How is this reference set?
Hi. Thanks for replying. You are going to have to forgive me because as I said I am a novice and have done most of this through videos etc.
The idea is that there is no controller, but only a motion controller that captures the users arm movement. The user is moving their arms and the faster they move the faster the character moves, so there is no need to move around the level. So, the Spline is just a fixed point for the character to move on. It also records the user’s stats like the distance they have travelled.
So, I created a Spline (SwimSpline) variable and used that in the player blueprint. Then when I put the player in the level, I just assigned the SwimSpline to the character. This then enabled him to move up and down the spline.
But now when the player is spawning into the level I don’t know how to assign the player to the SwimSpline and was hoping there was a way to do it in the Level blueprint. I didn’t know if doing something like ‘Get Actor of Class’ would allow me to set the SwimSpline or not
Once the variable in the character is exposed, a new pin will show up on the Spawn Actor from Class node. You can feed the newly spawned character actor the spline reference.