- Home /
How can i make one Character controller/rigidbody go inside another Character controller/ rigidbody?
I actually have many question with my project i am currently trying to do. I am pretty new to unity, but i have a B.S. in Game design and have completed the tutorials so i have some idea of what is going on. Anyways I am making a 2d puzzle platformer. In it you play as a parasite that in fest animals to use them to complete puzzles to get through the level. 1.)I am wondering on what would be the best way to do this. Right now i am just switching control to animal, deactivate gravity on the parasite, moving the parasite somewhere far away, and activating the animal. While this works it is not the best solution. I would ideally like to just have the parasite inside the animal. 2.)The other problem with my solution is that when you get out of the animal, it rockets skyward like 130 units before falling to a point like 5 units above the ground. 3.)Lastly for now i need to be able to have the parasite walk past the animals ( along with animals walking past other animals), but i need them to know when they are touching and they need to not fall threw the ground and things like that. I know this is kind of confusing so if you need anything cleared up please just ask. Any help i can get with this would be great. Thanks much.
I think, you are confused on how to approach this. When you say inside the Animal I assume like really in there digestive track. Ins$$anonymous$$d of forcing colliders into another and dealing with rigidbody problems. $$anonymous$$eh. This gets ugly.
Oh when the parasite goes in the animal, you could make an animation of this happening then the question is how do I get the CC to work inside the animal? Answer is simple, make a new scene. Don't fore the objects into another, but rather make it a whole new scene in which the parasite interacts with. This is could be "in the animal"
Thanks for the answer, but that is not exactly what i am looking for.when the parasite goes in the animal it kinda just goes awayand you take over control of the animal going through the level as the animal until you decide to have the parasite leave the animal.
Answer by Jeff-Kesselman · Nov 11, 2014 at 06:58 PM
i think your question is misleading and overly complex. Your clarification here simplifies it greatly:
"when the parasite goes in the animal it kinda just goes away and you take over control of the animal going through the level as the animal until you decide to have the parasite leave the animal."
Nothing goes "inside" of anything on a code level. You simply remove the "parasite" and turn on a component on the animal that reacts to player controls. When you "leave" you create a new parasite object and deactivate the previously activated component.
Your fundamental problem here was that you were thinking of the problem in too literal simulation terms. Don't think about the fiction, think about the effect and you will program much better.
Answer by Kiloblargh · Aug 02, 2013 at 06:35 PM
You need to have your colliders as triggers, it looks like most of the time actually colliding isn't really what you want to happen. You probably should not be using physics at all for characters in a 2d platformer, but program your own fake physics to get the exact behaviour you want.
(Surely a 2d platformer with fake physics is something you have to have already done in a game design degree program...?)
Yeah ok i was just hoping maybe there was an easier way to do it other writing my own physics. i am sorry if it sounded like i was not trying to brag when talking about the gamedesign degree i just want you to know i know at least somewhat about what i am talking about.
Your answer
Follow this Question
Related Questions
Physics AddForce reduced when 3 objects are colliding 1 Answer
CharacterContronller characters colliding with Rigidbody characters 1 Answer
Turn Gravity on when collision occurs 1 Answer
Making Colliders/Triggers or Rigidbodies move a Character Controller 5 Answers
Unity 4.3 CharacterController collision with physics 2D not working 1 Answer