[SPOILER]Things i am using:
- Generic Shooter (BP_PlayerCharacter, BP_BaseWeapon)
- My own scripted turret (TurretTeam0, TurretTeam1)
OK, so lets give you the scenario.
- Game starts and player is spawned with default weapons. (Rifle, handgun)
- Walk up to turret and press E to enter turret. (That is working fine. I can fire the turret projectiles with no problems)
- Press E again to exit turret. (Here is the hard part for me. When i press E to exit, it spawns and possesses a new character BUT, also new default weapons) (I can remove the function to give default weapons to the character on spawn but then my character has no weapons)
So i placed some weapon spawn pods inside the map so I can at least have a weapon. But when I pick up the weapon, go into the turret and leave the turret, i no longer have that weapon i picked up.
I can possess the turret and get out of the turret easily. But the problem is, when exiting the turret, the game does not keep what weapon I had on the character because the character gets destroyed when possessing the turret and then recreated when exiting the turret.
My question to you guys:
How do I make the vehicle or character remember what weapons I had on when entering the vehicle and then give them back to me when i exit the vehicle with all the ammo correctly remembered. (For example. I have 120 ammo when picking up weapon. I fire weapon 2 times to then give me 118 ammo. I enter turret and exit turret and I then have 118 ammo again.)
When possessing the turret, place the current weapon on me into an array along with its ammo and then when exiting the turret using the info inside the array give it to the newly spawned character.
My blueprint issues:
I am not very good at using arrays and dont know where to place the array code. (Inside the turret?? Inside the BP_BaseWeapon?? Inside the BP_PlayerCharacter??)
Can anyone shed some light on this please. I really need some help. Been trying to figure it out for 3 days now, with searching google for answers and reading forums but i cant seem to find anything that would help me out.[/SPOILER]
The SPOILER above is all fixed but I now have just 1 more issue. I have made the blueprints now so that my character is attached to a vehicle and then controls the vehicle. BUT when I exit the vehicle with the DetachActorFromActor node, and then use the SetActorLocation, with GetActorLocation + GetActorRightVector X -100 Int…the SetActorLocation spits my character out of the vehicle at the location of where i got into the vehicle in the first place.
How do i make my character move with the vehicle (Character is hidden but a mesh is visible inside the vehicle) and then set location of my character next to the vehicle?