- Home /
Collision update speed
Hi there
I hope the titel is not confusing. I didn't know how to phrase my problem. For practicing puposes I'm trying to recreate Temple Run. I'm working right now on the script to "pick up" coins. The way I programmed the game so far is, that the players position is fixed and the ground and the coins are moving towards him. The player has a character controller atached to it and following script:
function OnTriggerEnter (other : Collider) {
Destroy(other.gameObject);
}
The coins have a box collider attached to them, set on trigger.
I have three "rows" where coins can spawn (like in temple run). The script kinda works on the left and right. I can pick up coins. But not all of them. The script "skips" a few. But in the middle it doesn't work at all.
Some ideas why that is?
Thanks, mitti2000
You might try upping the physics solver count. Go to Edit/Project Setting/Physics.
You might also change the Collision Detection on the Rigidbody component to "Continuous".
Uppint the solver count helped for the left and right coins. But I didn't have a rigidbody on the coins. I added that and now everything works perfect. Thanks
Your answer
Follow this Question
Related Questions
Odd character controller behavior when a shield object parented to child 0 Answers
CharacterController colliding with normal Box Colliders 1 Answer
Object moving too fast, so that the collider does not work (C#) 2 Answers
How do I use a power up to change the character I'm controlling? 3 Answers
Determinism of collision judgment of Character Controller 0 Answers