Im trying to use UE4 and the Rift to create architectural visualizations (im new to UE4). I would like to make the character strictly follow a spline (always looking forward along the line, which could have turns) but let the player choose with W or S how far on the spline they want to be, i dont know if im explaining myself well. Its basically like a matinee but with the player controlling when they move “forward along the spline I created”. I think that this method will lower the motion sickness of a person when they know they are free to look around but are limited to move in “one” direction (kinda like a nice and soft roller coaster).
I’ve seen this done in side scrolling games but I was wondering how to do that in a 1st person scenario using the Oculus rift.
Does anyone know how to do this? Any help and videos are welcomed!
Make the spline variable editable in your pawn. You will also need to make a spline blueprint. Then place the pawn and a spline in the level, if you click on the pawn you’ll be able to set the value of the spline variable to be the one you’ve placed in the map.
So far I have only manages to create a Blueprint:SpectatorPawn and a regular Blueprint:Actor (which I managed to make a spline inside of it as a component). The picture you sent me is inside the BP for the SpectatorPawn but how do I name the Spline from the actor and bring it there?
Yep, that’s what I meant, an actor blueprint with a spline component, sorry, that wasn’t clear.
To add a reference to the spline in the pawn, you’ll need to have the spline blueprint first. So say you called it BP_MySpline, then in your pawn, create a variable and in the variable type, type in BP_MySpline and it should come up.
If you make that variable editable, when both are placed in the map and you click the pawn, you’ll see in the spline variable in the defaults, you can select the spline you’ve placed in the scene.
Hi,
I think I was able to add the MySpline_BP into the SpectatorPawn. I also made it editable, but for some reason I cant drag the SpectatorPawn into the world and some of the commands you posted in your first picture, i cant find.
I dont know why you cant see the pictures they seemed fine when I first uploaded them…
I also cant join the MySpline output into the “Targe” input (Spline Component Reference is not compatible with Spectator Pawn Reference)
Not sure if the “Get Distance Along Spline at Spline Point” is the one you have there. The box with the PLUS sign, i dont know it’s name and the final set distance along spline either
The spline shouldn’t be a part of the pawn, it should be a separate blueprint actor with just a spline component in it.
The DistanceAlongSpline variable I used is just a float I’ve added, you can call it anything you like. So just add a float variable, with a default value of 0. If you drag that into the graph, you’ll have the option to set and get it, which is all I am doing there.
The Plus node is just a node for addition of two floats, if you type “+” in the menu you will see “float+float”
If you drag off from MySpline there and type in Get World Location, does it come up?
Edit: Also, I just tried and I can’t drag the pawn into the scene either, but if you have it selected and right click in the map you can add it that way
I managed to put the Spectator as you said into the world!
Now im only missing the spline in the spectator_BP… My spline is a BP by itself that I dragged into the world… am I doing something wrong?
Ok, I redid the SpectatorBP and now I can see the Spline and set it as a default. Now when I press play (after I selected the Spectator as the default Pawn Class in the Project management) It jumps to the middle of the Spline and I cant move and i get 400 errors afterwards.
I just moved everything to the Contruct Script Tab and now the error went away but the Input Key W for forward wont show up there… I moved everything back.
Ok, set the default to none and then in the Spectator to Player 0, I still seem to spawn in the point 0,0,0 and i get the 400 errors “Access none ‘The Spline’ from construction…” but if I move everything to the construction tab, then i cant have the “InputAxis Forward”
It definitely should not be in the construction script.
In your spline blueprint, is NewVar 0 what the spline component is called? It should only have one component, just that spline
wait, i think its working! I forgot to set the spline back again inside the Spectator in the default tab, since I redid it…! let me check if its working as intended now