Hola tengo una duda y es por que al no quitarle la colision al objecto el objecto viene hacia mi al apuntar al suelo el video para que se entienda mas y el codigo abajo
https://www.youtube.com/watch?v=IXUsKMsBsn8&feature=youtu.be (//%5Byoutube%5Dhttps://www.youtube.com/watch?v=IXUsKMsBsn8%5B/youtube%5D&feature=youtu.be)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class constr : MonoBehaviour {
public GameObject fogata;
Vector3 targetPosition;
public bool construir = false;
public bool mostar = false;
public GameObject obejc;
public float rotate = 0.0f;
public float altura = 0.0f;
public float altu_defautl = 0.0f;
public float rotate_2 = 0.0f;
public int contador = 0;
public bool tocar = false;
public Collider payer;
void Start()
{
targetPosition = transform.position;
}
void Update()
{
if (Input.GetKey(KeyCode.R) && mostar)
{
rotate += 0.45f;
obejc.GetComponent<Transform>().eulerAngles = new Vector3(obejc.transform.rotation.x, rotate, obejc.transform.rotation.z);
}
if (Input.GetKey(KeyCode.T) && mostar && !tocar)
{
contador++;
if (contador == 0)
rotate = 45.0f;
if (contador == 1)
rotate =