Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

coding help

A topic by Dan Campbell created Jan 23, 2021 Views: 309 Replies: 9
Viewing posts 1 to 5

Hey everyone, this is my first game jam and need some help. I have a ghost character who will be able to merge through objects but cannot jump. I also plan to have a human character who switches in place of the ghost who can jump and stand on objects. Rather than have two characters in the scene, I want to be able to switch on the fly. Any tips on how to do this? Would be greatly appreciated. 

Submitted

Are u using unity?

Yep

Submitted

P.S if u are use 

<name of class>.enabled=true

Great, thank you for this! This should get me going.

Submitted

what it does is basically make the class work or not

(1 edit)

I did character switching in the pass and I found that spawning the new character at the same position and delete the old one would be a better approach than disabling the gameobject. Thats because even you disable the character object, you'll still preserve all the properties of that character at the moment it was disabled, meaning the velocity and the sprite .etc would remain the same as before when you disabled it.

I will give this a try,  thank you!

Deleted post
Deleted post