Hi all. I am at the end of my tether here my game hinges upon this mechanic. I have tried looking at tuts, asking on the discord server, but every solution, either through ineptness and lack of knowledge has resulted in dismal failure. So I am asking outright for a bit more detailed help. Assume I know nothing.
The game as it stands so far:
- Has a Player with multiple (at least two weapon sets) complete with topdown movement anims and melee and pistol
- Has a test arena already set up with barriers and collisions
- Has a main menu (NO ISSUES THERE)
How it plays now:
- Player can move diagonally and follow a cross hair in the direction its pointing at.
- Player can punch and kick (left and right click)
- Holding shift and forward and backwards, makes him run and anims respond accordingly.
- Pressing 1 and 2 keys switches character animation sets between fists and pistol with each its own anim sets
The Problem:
- when pressing 1 or 2 keys they switch weapons, but pressing the same button again (cuz it will happen by accident) spawns another copy in a random location. I need it to just switch weapons and even when pressing the same key again, wont spawn another copy of the character.
What I think I did wrong:
- I created the player as an object with a trigger once with a set size and it deletes the last player when switching weapons. Some one said I need to use variables and set anim states but I have failed to do so.
All I want is to switch weapons with no extra player spawning so I can add more weapon sets and anims.
What am I doing wrong?