- Home /
Moving Platform Collisions without CharacterController
I am trying to develop a platform game but I cannot get the player to collide with moving platforms.
All of the solutions I have found rely on using a CharacterController, but I am using a custom movement script from this tutorial:
http://www.youtube.com/watch?v=mN8alpNdTUk
How can I get the player to collide with the platform?
With the information given here, this question is likely unanswerable. The scripts in the video use 'custom' physics. That is, he is coding all collisions using Raycasting. From what I can tell, he is not using either Unity Rigidbody/physics or the CharacterController class. That means the fix will be specific to his classes. And my guess is that making this specific fix is beyond the scope of a Unity Answer question. That is, it will take the study and knowledge of multiple scripts from the tutorial in context with an application sample that demonstrate the problem in order to figure out what needs to be changed or extended. Unity Answers is designed for single, specific questions.
Answer by iHaveReturnd · Feb 18, 2014 at 09:24 PM
Just make sure your "player object" has a collider and a rigidbody on it. Sounds like you are missing the rigidbody component. (Component -> Physics -> Rigidbody with your object selected)
Make sure the ground object, or things you run on have colliders as well and that they are not set to triggers.
Answer by nightbane30 · Feb 18, 2014 at 10:18 PM
As iHaveReturnd said, add a rigidbody component to the GameObject and make sure to check the box, "Is Kinematic." I had trouble with this kind of stuff to at first when I started out with Unity. If you're using Unity's built in animation system, also check, "Animate Physics." This should fix most of the errors!
Off topic: iHaveReturnd, by any chance, are you a Black Adam fan?
No sadly, my handle came from Dragoon units in Starcraft 1 :D
Your answer
Follow this Question
Related Questions
How to move multiple dynamic gameobjects with one moving platform which is controlled by the player 0 Answers
Collision problem 1 Answer
Unreliability of Physics.Raycast.Distance for player movement? 0 Answers
Player shaking when colliding with objects 3 Answers
Simple Movement Game: Physics vs Manual Collision Detection? 2 Answers