I'll quick ask my question, then go into the details of it afterwards.
How can I make a vehicle's pre-existing inventory items relevant to a player who gets in the vehicle?
I am trying to attach hand weapons to vehicles for use by the driver. The way I went about this was by just adding a weapon to a vehicle's inventory. A vehicle is a pawn, so this works. With some slight additions to the weapon/vehicle code this works perfect in a listen server, but not on a dedicated server. So I assume I'm having a replication problem.
The problem is: when a player gets into a vehicle, the player has no access to the weapons that the vehicle is spawned with. If a player drives over a pickup they can pickup the weapon and everything works correctly. The problem is only with weapons that the vehicle spawned with. I am guessing that the inventory on the vehicle is somehow not relevant to the player when they get the vehicle. The vehicle actually owns the weapons, so in the weapon code I made bOnlyRelevantToOwner = false. This made no difference. I tried making the weapon bAlwaysRelevant as well. That didn't work. I tried setting the owner equal to the player when someone enters the vehicle. That didn't work.
Can anyone offer suggestions? Thanks in advance.
How can I make a vehicle's pre-existing inventory items relevant to a player who gets in the vehicle?
I am trying to attach hand weapons to vehicles for use by the driver. The way I went about this was by just adding a weapon to a vehicle's inventory. A vehicle is a pawn, so this works. With some slight additions to the weapon/vehicle code this works perfect in a listen server, but not on a dedicated server. So I assume I'm having a replication problem.
The problem is: when a player gets into a vehicle, the player has no access to the weapons that the vehicle is spawned with. If a player drives over a pickup they can pickup the weapon and everything works correctly. The problem is only with weapons that the vehicle spawned with. I am guessing that the inventory on the vehicle is somehow not relevant to the player when they get the vehicle. The vehicle actually owns the weapons, so in the weapon code I made bOnlyRelevantToOwner = false. This made no difference. I tried making the weapon bAlwaysRelevant as well. That didn't work. I tried setting the owner equal to the player when someone enters the vehicle. That didn't work.
Can anyone offer suggestions? Thanks in advance.
Comment