Hi i am trying to create a ghost pawn so when i play my game and press the save button so s in my case it save the game. When i replay the game the ghost vehicle will spawn. I am having trouble with bringing in a variable from a blueprint to the game mode and having it set as a target. I would appreciate any help at all thank you.
Do you have a variable “car info array” in the GHOST SAVE GAME object class? Doesn’t look like it form this error…which is why they don’t link together.
Yes i have a car info array in my ghost save game i have it set to public so i can call it into other blueprints. The one issue i am having is that i can’t connect it as a target in another blueprint. But for he ghost save game object class i simply created it using a local variable. Thank you for spending your time helping me i really appreciate it.
Apparently the types does not match. Create Save Game Object returns type Ghost Save Game and Car Info Array requires an object of type Save Game.
Try to delete the Set Car Info Array node and pull the output pin from Set Ghost Save Game Object, type “Set Car Info Array” and see if it autocomplete your node. If it doen’t, either your object does not have a “Car Info Array” property or you have some sort of compilation problem. (It’s C++ or Blueprint only?)
Don’t create anything as a “local” variable that you plan on using outside of a specific blueprint or function it won’t be accessible. Save game variables can’t be local because you need to set them and pull data from them inside other blueprints. That might be the issue. Otherwise what Bruno said below is likely the issue. If you can’t set something directly off the save game object it doesn’t exist OR it’s a local variable which won’t work for the reasons mentioned above.
I will give it a try and comment if it works thanks for the response i really appreciate it.
Thanks for the response i will give it a try.
I have just attempted that and it does auto complete the one issue is that it doesn’t connect to it as a target and simply says it is not compatible.
Did you delete the “Set Car Info Array” node we see in your image and used the one you got with the “Create Save Game Object” output pin?
That is a very strange behavior, the engine shouldn’t had problem connection a object pin with his own methods. Can you post a picture of the autocomplete list with the mouse over the “Set Car Info Array” node so we can see the comments and another one of your “Save Game Object” blueprint?
Yes i will do i am currently not at 6th form right now so i don’t have access to my files on my computer but when i do i will post a screenshot of it. Thanks again.
I deleted the set car info array and did what you said and dragged out for the create save game object set cat info areay. It autocompleted however I still cannot set it as a target and it continues to come up with an error of it not being compatible. All I need is to get the variable from save game and bring it into my game mode and set it there. Is there any other way around this. Thank you for you help.
Screen shot your save game object blueprint with all its variables, something is clearly missing from that.
The “Set Car Info Array” node from your first picture is not from the blueprint of your second picture. The “Ghost_Save_Game” property is called “Car Infoarray” and the one you’re using is called “Car Info Array”. Does it works with a node called “Set Car Infoarray”?
Try this:
- Delete the “Set Car Infor Array” node from Buggy.
- Delete the “Create Save Game Object” node from Buggy and recompile this blueprint
- Delete the “Car Infoarray” property from Ghost_Save_Game and recompile this blueprint
- Create the “Car Info Array” property again in Ghost_Save_Game and recompile this, again
- Go to Buggy, create the “Create Save Game Object” node again, pull its output pin and select the “Set Car Info Array” node.
That worked however it still would not let me connect to it as a target one way that i got around that was simply casting to the the ghost save game. To make my ghost vehicle work i had to un tick simulated physics in the ghost vehicle.