Герой проходит сквозь стены, колайдеры висят и на стенах и на игроке, на игроке так же висит риджет бади что делать? using System.Collections; using System.Collections.Generic; using UnityEngine;
public class PlayerMuvement : MonoBehaviour { public Rigidbody rb; public float Speed = 50; public Vector3 newVector3; // Start is called before the first frame update void Start() { rb = GetComponent<Rigidbody>(); }
// Update is called once per frame void Update() { newVector3.z = Input.GetAxis("Vertical"); newVector3.x = Input.GetAxis("Horizontal"); rb.MovePosition(rb.position + newVector3 * Speed * Time.deltaTime); } }
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMuvement : MonoBehaviour
{
public Rigidbody rb;
public float Speed = 50;
public Vector3 newVector3;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
newVector3.z = Input.GetAxis("Vertical");
newVector3.x = Input.GetAxis("Horizontal");
rb.MovePosition(rb.position + newVector3 * Speed * Time.deltaTime);
}
}