Okay, then we’ve traced to exactly what the problem is, but how to get those coordinates in blue/yellow to be valid before the orange?
A delay node? Because it’s a valid position, it’s just the wrong position.
Okay, then we’ve traced to exactly what the problem is, but how to get those coordinates in blue/yellow to be valid before the orange?
A delay node? Because it’s a valid position, it’s just the wrong position.
What you need to do is call the event after you turn the orange to the yellow.
You can have it spawn after that point, in the same execution so it’s guaranteed?
Like just ADD the spawn and possess etc to the same execution (white line), just make sure it’s AFTER the Transform Value is Set in that same white line!
Except they’re in entirely different blueprints…
The Pawn name and orange coordinates are printed out from the game mode BP. The blue and yellow coordinates are from the level blueprint. I had tried to keep it all in the same execution line from the level BP when I first started and I was getting the same thing, but with no car or control. I put it back that way with everything from the game mode BP in the level BP and changed it so it’s not using the new game mode at all.
I get all the strings printed out properly, including the orange, but no car and no control with the camera at the origin.
Whoa, wait, all of that, but no car?? That’s interesting. So two things:
If you dont want to override the function I mentioned, you can use this gamemode event.
This event is triggered when everything is set up, so you can find things on the maps, here you can put your spawn and possess it.
Okay, first on EventBeginPlay I’m casting to a custom Game Instance where I have variables stored so I can access them between level loads.
Then Get Actor of Class looking for the Player Start, Gets its Transform values, converts it to a String and Prints it (Blue Coordinate Readout)
Then Sets the Variable SpawnLocation (This is stored in the Game Instance, so I could access it in the Game Mode BP, but isn’t necessary if it’s all the level BP) Then converts it to a String again and Prints its value (Yellow Coordinate Readout)
This is mostly unrelated, I get the UltraDynamicSky BP in the level and apply Weather State that is set in another level and saved in the Game Instance. This loads the time of day and weather the player can choose and works just fine.
Then changes the Input Mode from UI Only to Game And UI.
Then Casting to the Game Instance again, which is probably redundant, but easier to work with than getting a pin from 3 screens back and gets the Variable SelectedCar (stored in the Game Instance and set in the previous level through a menu) Gets its name and Prints it as a String (this is the blue Velocity_Coyote, the car’s drivable blueprint)
Then it prints out the SpawnLocation coordinates again in orange (this wasn’t working from the Game Mode BP, but is fine here)
Then the SpawnLocation variable and it’s coordinates along with the Variable SelectedCar (Velocity_Coyote) go into SpawnActor
Then finally Possesses it with the Player Controller.
Now on to number 2.
Ok, I see that you’re printing the class, but not the object.
If you print the return value there, you can guarantee the existence of the object, removing a possible issue!
Okay I did part 2 of what you suggested and ejected from the playercontroller. No Velocity_Coyote car to be found anywhere.
I also put the print there, and got no result. But the spawning was working when I did it through the Game Mode instead of the Level Blueprint.
I didn’t think the tags would help, but maybe spawning a new player this way might.
I looked and looked and looked and could not find a reason it would fail to run the spawn node.
Maybe just run it on game mode, and use a 2 second delay before spawning, to ensure everything is built and the location is passed before spawn.
So I actually managed to fix the problem somewhat yesterday. I simply put a node to teleport the player to the Player Start after the coordinates returned and printed properly and ta da! I’m in the right location.
With one problem: There’s an untextured sphere there that you wind up on top of, which I presume to be the original Default Player Pawn spawning before possessing the car. The trick now is at which point to reference and destroy it without accidentally deleting the car the player should be in.
Hey, that’s awesome!
What I would try:
Get Player Character-> promote to variable"OldChar"-> Spawn car → DestroyActor “OldChar” → teleport car? Order of operations is important here, for sure.
Solved it already with a simple Get player pawn → destroy actor before spawning the car.
The problem I have now, and it’s even more bewildering is that one specific car gives me the problem of spawning at origin and having no control. Every other of the 9 cars work perfectly now, except one, they’re all from the same package and structured identically. The blueprint logic for selecting and spawning them is the same.
The only place where it’s any different is in the menu, and even still it’s the same exact nodes, copied and pasted, with the only actual difference being selecting the specific drivable blueprint for that car. I don’t even know what I could test with. The print strings are still working and show the right blueprint, but I get this
Every other car works fine and I get this
That’s probably going to require digging specifically into that car, unrelated to anything in this thread so far… In fact, I think it would be best to close this thread out, and make a new thread with this as the title to get some fresh eyes on it!