Object passes through other moving objects
Hi. I am working on a marble maze sort of game and creating the actual box the marble will move in. The game works by the box rotating around to move the ball. however, the ball passes in between the walls and bottom of the box shown in the video i attached. Both the ball and box have colliders and rigidbodies (the box is set to kinematic movement). I have tried making the walls thicker and adding extra layers to stop the ball but to no luck. I think it may be the fixed update not updating fast enough and i know there is a way to update faster using raycasts but i am not too experienced in them and i just wanted to see if that was the problem before diving straight in. Also i am using continuous dynamic.
Here is the code of the box: using System.Collections; using System.Collections.Generic; using UnityEngine;
public class BoardMovement : MonoBehaviour
{
Vector3 input;
void FixedUpdate()
{
input = new Vector3(Input.GetAxisRaw("Vertical"), 0, Input.GetAxisRaw("Horizontal"));
transform.Rotate(input * Time.deltaTime * 180);
}
}
Answer by turfyiscool · May 29, 2020 at 04:16 PM
Nevermind i figured it out myself! i only made the box colliders bigger which worked!
Your answer
Follow this Question
Related Questions
Freeze rotation of just the box collider component 0 Answers
Rotating Gameobject not Colliding 1 Answer
Rigidbody wont move after changing collider.bounds.center 0 Answers
Child gameObject with collider not colliding if parent has rigidBody 2 Answers
How to prevent object from entering other colliders 1 Answer