How do I switch the player controls. I basically want it so when I press a specific button my player to transform/morph into a different object that exists in the game and i think the best way to it would be to delete the current player object and create the new object at it’s location and then switch the controls to the new object so how do I do that. If you have any other way of doing what I mentioned above you can tell that too
A couple of things:
- Ideally you would have an invisible controller object that is separate from the character model. The character model always follows the controller object, but it’s the controller object that has the behaviours and collision. So you can replace the model, and keep the controller intact.
- Is it 2D or 3D? If it’s 2D, then you can can switch the animation on the same object.
you deactivate the behaviors that controls the character and active the behaviors on the other character.
I’d lean toward the controller-object approach if the morph also changes collision or movement, because deleting the player and creating a new one mid-input often drops the current velocity and can miss a just-pressed key. Keep one hidden object that owns the controls and collision, and only swap or hide the visible character at the same position. If both forms use the same movement, disabling one object’s behaviors and enabling the other’s is simpler — just do that swap in the same event as the button press so both objects stay picked.