Announcement

Collapse
No announcement yet.

Spawn Actor from Client and set its variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Spawn Actor from Client and set its variables

    Hello folkss!!!

    Can somebody help me? save me? rescue me?

    I am trying to make my client character Spawn a ammo box with what is left from it. the problem is that when i do that, even event replicated, the ammo box respaws with full ammo, not what is left from the client. i used to pass the variable but its not working, and tried to replicate the variable without sucess too.

    get item stats from inventory>spawn actor by client on server rpc > set actor variables.
    Attached Files
    Last edited by GoruptheDevel; 01-28-2018, 07:31 AM.

    #2
    Are you sure you are passing the ammo left variable to the ammo box when it is told to spawn?

    A good rule of practice is to have the object itself control its own variables. Make a function to adjust the ammo amount on the ammo box blueprint. Make it set it's ammo to whatever is passed into the function. Call that function in your player character and pass the ammo count to the ammo box's ammo changing function.
    Last edited by Yggdrasil; 01-29-2018, 03:03 PM.

    Comment


      #3
      Originally posted by Yggdrasil View Post
      Are you sure you are passing the ammo left variable to the ammo box when it is told to spawn?

      A good rule of practice is to have the object itself control its own variables. Make a function to adjust the ammo amount on the ammo box blueprint. Make it set it's ammo to whatever is passed into the function. Call that function in your player character and pass the ammo count to the ammo box's ammo changing function.
      i solved the problem. when i spawn the ammo box it, its variables were not replicated. thanks anyway!!

      Comment

      Working...
      X