Buenas noches francoe
en este caso no puedo trabajar con esa escala, cada objeto tiene una distinta
en este caso no puedo trabajar con esa escala, cada objeto tiene una distinta
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
private void Update()
{
if (Input.GetMouseButton(0)) // Si fuera DOWN se ejecutaria 1 vez. De esta menera detecta si el mouse esta siendo presionado.
{
}
if (Input.GetMouseButtonUp(0))
{
}
}
Input.GetMouseButtonUp(0)
Rigidbody RB;
private void Start()
{
RB = GetComponent<Rigidbody>();
}
void Update()
{
RaycastHit hit;
if (Physics.Raycast(transform.position,transform.forward, out hit, 10000)){
transform.rotation = Quaternion.LookRotation(-hit.normal);
RB.AddForce(-hit.normal * 100);
RB.velocity = ( transform.up * Input.GetAxis("Vertical") * 10);
}
}
Cita de: Igor date=1579980512no se si me he explicado bien.
Cita de: lightbug date=1580004949" I do a raycast from the player to the center of each gravity body collider in the scene, check for which raycasthit point is the nearest, then use the normal to determine the gravity direction each timestep. Hope that gives you an idea! "
Cita de: lightbug date=1579982611Está bien eso?
Cita de: Igor date=1579983991"gravedad por zonas"
Rigidbody RB;
private void Start()
{
RB = GetComponent<Rigidbody>();
}
void Update()
{
RaycastHit hit;
if (Physics.Raycast(transform.position,transform.forward, out hit, 10000)){
transform.rotation = Quaternion.LookRotation(-hit.normal);
RB.AddForce(-hit.normal * 100);
RB.velocity = ( transform.up * Input.GetAxis("Vertical") * 10);
}
}
void Retroceso()
{
punto_inicial = -mov_player.Vertical_mov;
mov_player.Vertical_mov -= 10;
StartCoroutine(fuerza_sobrante());
}
IEnumerator fuerza_sobrante()
{
for (float time = 0; time < 10; time ++) {
mov_player.Vertical_mov += 0.7f;
time++;
yield return new WaitForEndOfFrame();
}
}