Hi, I implemented this code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
Rigidbody rb;
public float speed;
void Start()
{
rb = GetComponent<Rigidbody>();
speed = 600;
}
void FixedUpdate()
{
Vector3 acc = Input.acceleration;
transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z);
rb.velocity = new Vector3(acc.x * 1000, -acc.y * 1500, speed);
}
}
The problem is one, if I apply it to a sphere with rb and sphere collider, when I move with the accelerometer input, the collisions detection is working fine, if I crash against a surface going left/right/up/down, I can’t go trough that surface. If I inport other prefabs from blender or unity asset and apply the same script, with rb and mesh colliders(or I even tried with sphere collider), the object goes trough the same surface. Can someone explain me why? Thanks