How to build a "endless runner" like course?
Hello everybody! I'm trying to build a course that spawn itself like in the "endless runner" tutorial. I was able to make it work following step by step the all thing and therefore modifying my gamemode blueprint. I'm now trying to avoid to make changes to to game mode, so I've tried to pretty much do the same thing using instead a new actor blueprint. Now, the course does appear at the beginning of the game, for the number of pieces specified in the ForLoop, but does not spawn new segments of it nor destroy the old ones while the pawn move through the trigger boxes.
I've used two different blueprints: A first one wich actually contain the mesh, the trigger and the arrow (as in the tutorial) plus this Get Attach Transform funtion
and this event graph (notice the warning!)
The Second blueprint is the one I've inserted in the scene wich calls this first one to work and it is composed of an AddFloor function
And its event graph (wich i belive works)
Any idea about where I might be doing wrong? I belive I still have not clear enough to concept of "casting"...this might be it! XD Thanks in advance to anyone who would spend his/her own time taking a look to my graphs!
asked Aug 23 '15 at 03:25 PM in Using UE4
Well, the errors already say what part of the problem is:
BP_FTunnel does not inherit from GameMode
Whenever you get an error of this sort, something is seriously wrong in your code and the node will never execute correctly. In this case, you won't be able to access your tunnel actor this way. Assuming the tunnel already exists in the map at that time (whether placed in the editor or spawned by another function), you could use a GetAllActorsOfClass node to find all existing actors of type BP_FTunnel. The node returns an array containing all existing actors of the given type. Use a Branch node to verify that the array's Length is greater than 0. If this returns true (at least one tunnel was found), you'll probably want to use the Get node with index 0 to get the first tunnel found. If no tunnel was found, you'll need to spawn it first.
ReturnValue is already a BP_FTile, you don't need Cast to BP_FTile
Whenever you see a warning like this, you can leave out the Cast to XYZ node.
answered Aug 23 '15 at 06:25 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here