Unity Tutorial: Point and Click Movement Using Navigation - Simple RTS [Creating Games! ~ A-2]

preview_player
Показать описание
*ACTIVATE THE ENGLISH SUBTITLES*

Whole play list at:

Second video of the Simple RTS tutorial series~

Finally starting to make Unity tutorials, rough start but I hope to improve as I make more of these.

The next video will show you how to control two units and how to block ray casting when clicking on UI elements.

Hope you enjoy it! (^_^)

Always looking forward to your feedback so feel free to leave a comment~
Рекомендации по теме
Комментарии
Автор

This is the MOST informative and straight forward video on this topic. I have been digging for a video like this and yours is perfect. THANK YOU :D

megaangryjoe
Автор

I love how clear and simple you have made these, Ill be watching closely :) I found your videos while looking for a simple way to get enemies to move to a random location within an array, my current project is not an RTS per se, but your work process is helpful enough for me to apply some ideas across, thankyou!

matthewhumphreys
Автор

I've just watched this only tutorial and its great!

Spoileron
Автор

I think i know why people have been having issues with this tutorial.

I have edited two things, namely inside the movement input script, and they have resulted in the originally intended activity as prescribed here.

Firstly, it seems that referring to the camera in the generic way initially used is what has been changed, i think you now need to manually define the camera that the script will be relating to in the "public Camera camera" line i added in the beginning of the class definition. Then, it is of course linked to the camera. Secondly, i found that the code is written to create a ray of a distance "100". My own setup of items required this value to be removed.

I know that the latter was definitely an issue, as i tested it, i am unsure about the camera part - but both changes have been made, and my code is working.
(Moveinput.cs)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveInput : MonoBehaviour
{

public Transform agent1Pointer;
public AgentMovement agent1Movement;
public float minMoveRange;
public SpriteRenderer cursor1;
public Camera camera;
// Update is called once per frame
void Update ()
{
//Input
if (Input.GetButton("Fire1"))
{
// Raycaster... Spot terrain destination.
RaycastHit hit;
Ray ray =

if (Physics.Raycast(ray, out hit))
{
if (hit.collider.tag == "Terrain")
{
// Debuggeriser!
Debug.DrawLine(ray.origin, hit.point);

// Move Ground-Cursor
agent1Pointer.position = new Vector3(hit.point.x, (hit.point.y + 1), hit.point.z);
// Doublecheck Minimum move distance.
if (Vector3.Distance(agent1Pointer.position, > minMoveRange)
{
agent1Movement.moving = true;
cursor1.enabled = true;
}
}
}
}
}
}

nyscersul
Автор

Hi. Very good tutoring, but you need to be more explanatory in the case of objects

lesnah
Автор

Hola Elias! Deduzco que hablas espanol, pero si prefieres ingles, me lo dices! Muchas gracias por tus videos, son invalorables para los que estamos empezando! Hace unos meses tuve una idea para un juego que creo que la romperia! El tema es que de programacion se muy muy poco! En realidad se poco de todo esto :( pero estudio obsesivamente! El juego seria un RTS, pero el personaje principal seria un barco, donde dentro vive su tripulacion! el tema es que seria Click to Move, como en tu video, pero no existe ni un video que explique como hacer click to move sobre el agua, entonces me detecta el terreno bajo el agua y es un poco raro, por otro lado, el movimiento no es realista, ya que a la vez que el barco empieza a girar (supongamos un giro de 180 grados), tambien empieza a transladase, pero no hacia adelante sino hacia el destino. o sea que mientras gira dse arrastra tambien de costado hacia el punto de destino, lo cual es muy poco realista para un barco, ademas son muy bruscos los movimientos, pero claro, uso un tipico script como el tuyo! No solo necesitaria que los movimientos sean mas suaves y con una cierta aceleracion sino que el barco primero gire y luego empiece a transladarse, o lo que seria mejor, es que dependiendo del angulo de giro, el barco describiese un pequeno semicirculo hasta alcanzar la direccion deseada siempre avanyando sobre su eje z (creo) Espero sea clara la explicacion y si te interesa te mando los scripts que estoy usando! Creo tambien que seria una gran idea para un video ya que no existe nada asi! Necesito mucha ayuda, y si te interesa, estoy buscando gente con quienes trabajar, la idea es muy original, ya te contare mas si te interesa! Por favor! Ayuda! ;) Si tienes algun canal privado para comunicarnos, te lo agradeceria! Un abrazo y desde ya muchas gracias! Rodrigo

rodrigomartinez
Автор

Hey Nice One, but when i use the camera follower, he follw the player and zoom in the map any method to fix the value of Y ???

l-yakuza
Автор

when i click the sprite no change position to where i click.why?

shinigami
Автор

did everything but nothing is happening when i launch the character is not moving....

amurotensei
Автор

Hi, can you send me the scripts of this series please?:D

idkbalazs
Автор

can you add the source code in the description

stepheng
join shbcf.ru