How to switch a player's Prefab on item pickup
Alright, so I am working on a Top-Down 2D shooter as my first Unity Game. After going through a bunch of tutorials to start learning basics of Unity and some networking to get multiplayer up and running I stumbled upon a problem I have not found an answer to.
Basically what I have is 1 Player Prefab made using sprites of a man holding a pistol with all of the animations working using MechAnim.
The problem I have found is, how would I got about switching the player (Network-aware aswell of course) to another Prefab made from sprites of a man holding a rifle for example.
I have found people saying I could switch the player's gameobject (say when he walks over a weapon on the ground), but I would need to preserve rotation and position and have the new gameobject's animations work seamlessly.
Would I just need to make a second prefab with all the mechanims, scripts and all the bell's and whistles and then switch gameobject? If so, how would I pass control to the new gameobject, delete the old one, create the one one with the same x and y and rotation and make this all Network-Aware?
Your answer
![](https://koobas.hobune.stream/wayback/20220612160757im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
HELP 2D Top Down Shooter Bullets Only go Horizontal 0 Answers
How do i make character eyes blink after some seconds have passed? (on 2D sprite) 1 Answer
Change sprite collection 1 Answer
My sprite size changes between animations? 4 Answers
Enemy pathfinding script for a 2D top down shooter game 0 Answers