The gun gets created proprely but it seems sometimes i cant acess the propeties of the weapon parts, if i do this way above.
When i had this gun creation code on construction script i could acess the properties with no problems, but when this proertis are set on the custom event i cant acess it well
This is how i am trying to acess the weapon properties on my player character:
With the Custom node that creates the random gun tsome of those propertis doesnt get acessed, but the exate same code on the construction script works like it should.
so my question is: Is there any way to set the variables of a certain actor after it gets spawned?
Thank you for the sugestion, but do you know how can I set a spawned actor variables on spawn, for example: i wanted to each time a spawn a weapon this would have diferent fire rates, recoil etc… Like i said before, i was able to do this in construct script but only worked with random ints or predifined int values, but now i want to be able to build my weapon…
I found that the problem was that when spawn the value would get multiplied and get huge numbers, resulting on the values like fire rate to by increased (resulting on slower fire rate, since the fire rate is the time between the shots), dont know why tho, i tried to put a do once node on the create weapon event but still multiplies the numbers but not so much like before…
It was a the event tick that was causing it, it solved now… Thanks for the help One more thing if its not much to ask:
When i drop the weapon, instead of keeping the parts, the guns resets to its defaults, Im doing the same principle of creating weapon as before but now at a diferent location, I keep the variables of the gun i own and then transfer to the other spawn actor of class weapon, creating a new gun with the same stats and parts and deleting the one i owened, but this time its doesnt keep the varibles i was supose to transfer, resulting on the weapon getting reset to the default values.
Ps: im doing this instead of deatch actor because i dont want it to be a child actor (because of save games issues)
Hmmm, it must be that the settings aren’t getting through, somehow. It will be in your code, just work through it slowly… ( lots of print strings ( easier that the debugger ) )…
Don’t save actor references. I don’t think it works after packaging.
But anyway, even if you could, anything associated with the actor doesn’t get saved ( only the outliner name ).
You need to pack all the class types and settings into an array of structs. When you later read the save game, you can create the classes and reset the settings from the structs.
That’s the way it is with the save gave. It does nothing for you…