domingo, 28 de marzo de 2021

nivel, 4 warlike_feats,

 😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁

 APOYA ESTE GAME...SOLO ES UNA SUGERENCIA....JAJAJAJAJJAJAJAJAJA¡¡¡¡¡¡😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁


jueves, 25 de marzo de 2021

Como hacer ítems de recuperar vidas con Unity



Como hacer ítems de recuperar vidas con Unity, aquí pongo los scripts en el blog, es muy sencillo solo se cambia una linea que pone el signo – menos por otra linea que pondremos el signo +mas, el mismo script pero con otro nombre y el mismo texto que utilizamos en el mismo camvas,

cuando toquemos los ítems que son unos cubos con la cruz roja sumara vidas el player cuando le alcances las balas del enemigos restara vidas el player en este caso el tag de sumar se llama “cruz” y el tag de restar se llama “pomada”.

 

  using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class restavidaamericanodeintrocuarta : MonoBehaviour {


        // Create public variables for player speed, and for the Text UI game objects
        public float speed;
        public Text countText;
        public Text winText;

        // Create private references to the rigidbody component on the player, and the count of pick up objects picked up so far
        private Rigidbody rb;
        private int count;/// <summary>



        // At the start of the game..
        void Start ()
        {

            rb = GetComponent<Rigidbody>();

            // Set the count to zero 
            //count = 0;////original
            count = 10;
            // Run the SetCountText function to update the UI (see below)
            SetCountText ();

            // Set the text property of our Win Text UI to an empty string, making the 'You Win' (game over message) blank
            winText.text = "";
        }


        void OnTriggerEnter(Collider other) 
        {


            if (other.gameObject.CompareTag ("pomada")){

                other.gameObject.SetActive (false);///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                // Add one to the score variable 'count'
                //count = count + 1;//////original
                count = count - 1;

                SetCountText ();
            }
        }

        // Create a standalone function that can update the 'countText' UI and check if the required amount to win has been achieved
        void SetCountText()
        {


            // countText.text = "VIDAS: " + count.ToString ();///original
            countText.text = "AMERICANO VIDAS: " + count.ToString ();
            // Check if our 'count' is equal to or exceeded 12
            //if (count >= 10) ////original
            if (count <= 1) 

                //if (count >= 99) 
            {
                // Set the text value of our 'winText'
                winText.text = "TE HAN MATADO";

                //Destroy (gameObject, 1.2f); 
                Application.LoadLevel (3);


            }
        }
    }



---------------------------------------------------------------------

-------------------------------------------------------------------



using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SUMAVIDASAMERICANOINTROCUARTA : MonoBehaviour {



        // Create public variables for player speed, and for the Text UI game objects
        public float speed;
        public Text countText;
        public Text winText;

        // Create private references to the rigidbody component on the player, and the count of pick up objects picked up so far
        private Rigidbody rb;
        private int count;/// <summary>



        // At the start of the game..
        void Start ()
        {

            rb = GetComponent<Rigidbody>();

            // Set the count to zero 
            //count = 0;////original
            count = 10;
        //count = 0;
            // Run the SetCountText function to update the UI (see below)
            SetCountText ();

            // Set the text property of our Win Text UI to an empty string, making the 'You Win' (game over message) blank
            winText.text = "";
        }


        void OnTriggerEnter(Collider other) 
        {


            if (other.gameObject.CompareTag ("cruz")){

                other.gameObject.SetActive (false);///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                // Add one to the score variable 'count'
                //count = count + 1;//////original
                count = count + 1;

                SetCountText ();
            }
        }

        // Create a standalone function that can update the 'countText' UI and check if the required amount to win has been achieved
        void SetCountText()
        {


            // countText.text = "VIDAS: " + count.ToString ();///original
            countText.text = "AMERICANO VIDAS: " + count.ToString ();
            // Check if our 'count' is equal to or exceeded 12
            //if (count >= 10) ////original
            if (count <= 1) 

                //if (count >= 99) 
            {
                // Set the text value of our 'winText'
                winText.text = "TE HAN MATADO";

                //Destroy (gameObject, 1.2f); 
                Application.LoadLevel (3);


            }
        }
    }






😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄😄

👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👌👌👀👀👀👀👀👀👀👀

EJEMPLO DE ITEMS CON UNITY

👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌


👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄👄

COMO HACER PERSECUCIONES INTELIGENCIA ARTIFICIAL DE ENEMIGOS

 😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁

 

miércoles, 24 de marzo de 2021

Enemigo, especial ,



0,2,7 versión de warlike_feats, sigo trabajando en el videojuego, pongo la versión para quien quiera probarla e imágenes de las futuras mejorías que se verán muy pronto en el videojuego, como la idea de un enemigo especial mas poderoso de lo normal que tiene 1000 vidas y me persigne por el terreno de juego, también una mejora en el aspecto grafico para que se vea con claridad quien suma puntos en el videojuego y quien pierde vidas, e puesto una imagen en las puntuaciones para que el jugador sepa con claridad que es lo que esta pasando a lo largo de la jugada……...

 

 

domingo, 21 de marzo de 2021

c#, disparos con Unity,

 


DISPARO A DISPARO LENTO----------------

  /// <summary>
/// Launcher.
/// 
/// 3/2/2013
/// Steve Peters
/// Game Developers Guild - Miami, FL
/// 
/// Allows us to launch projectiles at a wall. It preinstantiates and stores the projectiles in a 
/// stack to improve performance
/// </summary>
using UnityEngine;
using System.Collections;

public class Launcher : MonoBehaviour
{
    
    public Rigidbody projectile;
    public Rigidbody explosiveProjectile;
    public float launchspeed = 50;
    public bool useExplodingProjectiles = false;
    
    private float _LaunchDelayTime = 0.0f;
    
    public int stackSize = 60;            
    public Transform launchHole1;
    public Transform launchHole2;
    
    private Stack _Projectiles;
    private Stack _ExplosiveProjectiles;
    private Transform _myTransform;
    
    // Use this for initialization
    void Start ()
    {
        _myTransform = transform;
        _Projectiles = new Stack();
        if(useExplodingProjectiles)
        {
        _ExplosiveProjectiles = new Stack();
        }

        for(int i = 0; i <  stackSize; i++)
        {
            Rigidbody tr = Instantiate (projectile, _myTransform.position, _myTransform.rotation) as Rigidbody;
            PushProjectile(tr);

            if(useExplodingProjectiles)
            {
            Rigidbody rr = Instantiate (explosiveProjectile, _myTransform.position, _myTransform.rotation) as Rigidbody;
            PushExplosiveProjectile(rr);
            }
        }
    }
    
    // Update is called once per frame
    void Update ()
    {
        if(_Projectiles.Count > 0)
        {
            if(Time.time > _LaunchDelayTime)
        {    




                if (Input.GetButton ("Fire1")) ////ametralladora
        //    if (Input.GetButtonDown ("Fire1")) original tiro a tiro

            {
                Rigidbody tr = PopProjectile();
                tr.gameObject.SetActive(true);
                tr.transform.position = launchHole1.position;
                tr.transform.rotation = launchHole1.rotation;
                tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);
                
                tr = PopProjectile();
                tr.gameObject.SetActive(true);
                tr.transform.position = launchHole2.position;
                tr.transform.rotation = launchHole2.rotation;
                tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);
                    
                _LaunchDelayTime = Time.time + 0.5f;
            }
        }    
        }

        if(useExplodingProjectiles)
        {
        if(_ExplosiveProjectiles.Count > 0)
        {
            if(Time.time > _LaunchDelayTime)
            {    
                if (Input.GetButtonDown ("Fire2")) 
                {
                    Rigidbody tr = PopExplosiveProjectile();
                    tr.gameObject.SetActive(true);
                    tr.transform.position = launchHole1.position;
                    tr.transform.rotation = launchHole1.rotation;
                    tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);
                    
                    tr = PopExplosiveProjectile();
                    tr.gameObject.SetActive(true);
                    tr.transform.position = launchHole2.position;
                    tr.transform.rotation = launchHole2.rotation;
                    tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);
                    
                    _LaunchDelayTime = Time.time + 0.5f;
                }
            }    
        }
        }
    }
    
    public void PushProjectile(Rigidbody x)
    {
        x.gameObject.SetActive(false);
         _Projectiles.Push(x);
    }
    
    public Rigidbody PopProjectile()
    {
        return (Rigidbody)_Projectiles.Pop();
    }

    public void PushExplosiveProjectile(Rigidbody x)
    {
        x.gameObject.SetActive(false);
        _ExplosiveProjectiles.Push(x);
    }
    
    public Rigidbody PopExplosiveProjectile()
    {
        return (Rigidbody)_ExplosiveProjectiles.Pop();
    }
}

 

 

 

  DISPARO A DISPARO RAFAGAS MUY RAPIDO IMITA AMETRALLADORA---------------

 

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

public class launchermasvelocidad : MonoBehaviour {


        public Rigidbody projectile;
        public Rigidbody explosiveProjectile;
        public float launchspeed = 50;
        public bool useExplodingProjectiles = false;

        private float _LaunchDelayTime = 0.0f;

        public int stackSize = 60;            
        public Transform launchHole1;
        public Transform launchHole2;

        private Stack _Projectiles;
        private Stack _ExplosiveProjectiles;
        private Transform _myTransform;

        // Use this for initialization
        void Start ()
        {
            _myTransform = transform;
            _Projectiles = new Stack();
            if(useExplodingProjectiles)
            {
                _ExplosiveProjectiles = new Stack();
            }

            for(int i = 0; i <  stackSize; i++)
            {
                Rigidbody tr = Instantiate (projectile, _myTransform.position, _myTransform.rotation) as Rigidbody;
                PushProjectile(tr);

                if(useExplodingProjectiles)
                {
                    Rigidbody rr = Instantiate (explosiveProjectile, _myTransform.position, _myTransform.rotation) as Rigidbody;
                    PushExplosiveProjectile(rr);
                }
            }
        }

        // Update is called once per frame
        void Update ()
        {
            if(_Projectiles.Count > 0)
            {
                if(Time.time > _LaunchDelayTime)
                {    




                    if (Input.GetButton ("Fire1")) ////ametralladora
                        //    if (Input.GetButtonDown ("Fire1")) original tiro a tiro

                    {
                        Rigidbody tr = PopProjectile();
                        tr.gameObject.SetActive(true);
                        tr.transform.position = launchHole1.position;
                        tr.transform.rotation = launchHole1.rotation;
                        tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

                        tr = PopProjectile();
                        tr.gameObject.SetActive(true);
                        tr.transform.position = launchHole2.position;
                        tr.transform.rotation = launchHole2.rotation;
                        tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

                        _LaunchDelayTime = Time.time + 0.1f;
                    }
                }    
            }

            if(useExplodingProjectiles)
            {
                if(_ExplosiveProjectiles.Count > 0)
                {
                    if(Time.time > _LaunchDelayTime)
                    {    
                        if (Input.GetButtonDown ("Fire2")) 
                        {
                            Rigidbody tr = PopExplosiveProjectile();
                            tr.gameObject.SetActive(true);
                            tr.transform.position = launchHole1.position;
                            tr.transform.rotation = launchHole1.rotation;
                            tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

                            tr = PopExplosiveProjectile();
                            tr.gameObject.SetActive(true);
                            tr.transform.position = launchHole2.position;
                            tr.transform.rotation = launchHole2.rotation;
                            tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

                            _LaunchDelayTime = Time.time + 0.5f;
                        }
                    }    
                }
            }
        }

        public void PushProjectile(Rigidbody x)
        {
            x.gameObject.SetActive(false);
            _Projectiles.Push(x);
        }

        public Rigidbody PopProjectile()
        {
            return (Rigidbody)_Projectiles.Pop();
        }

        public void PushExplosiveProjectile(Rigidbody x)
        {
            x.gameObject.SetActive(false);
            _ExplosiveProjectiles.Push(x);
        }

        public Rigidbody PopExplosiveProjectile()
        {
            return (Rigidbody)_ExplosiveProjectiles.Pop();
        }
    }

sábado, 20 de marzo de 2021

Nace un desarrollador de videojuegos indie.

 


0,2,6 versión de warlike_feats,


 

0,2,6 versión de warlike_feats, pongo aquí esta ultima versión para jugarla y descargarla, si la queréis probar, y una captura de video, a apartir de aquí are sobre papel los siguientes niveles, versiones del videojuego para concretar mejor lo que quiero poner en las pantallas, de momento voy añadiendo atrezo para intentar darle el máximo ambiente de guerra de la época, y pondré un script para que al llegar a cierto numero de puntos se abra la 3 parte del videojuego, esto me va ir mas lento porque quiero basarme primero sobre lo escrito en papel y con dibujos de los escenarios y anotaciones , que también pondré en el blog durante estos próximos días…...

 


martes, 16 de marzo de 2021

Se vende

 

Warlike feats, "the documents", unity, niveles,sumar puntos,perder vidas,

 

warlike feats, "the documents" Sigo trabajando en el videojuego y voy ha escribir una descripción de lo trabajado asta ahora, de los objetivos del videojuego...e empezado un nuevo nivel y doy por finalizado el primero.


El argumento base es un soldado americano que entra en una fortificación alemana para robar unos documentos, planos , papeles , fotografiás etc sobre armas secretas en evolucion de estos enemigos, el videojuego esta inspirado en la historia sobre la segunda guerra mundial, y sobre el cine bélico otros videojuegos, documentales, etc, etc,.

Bien describo el primer nivel y los objetivos para superarlo, lo fundamental tienes 10 vidas que has de mantener ante todas las cosas si no el juego se reinicia al principio y has de empezar de cero, abatir y destruir a los soldados enemigos, poner bombas en algunas torres de vigilancia, y saltarte las zonas donde hay minas porque si no vas a perder el juego al morir constantemente, aunque también puedes destruirlas disparando o lanzando granadas solo por diversión….

Las torres de vigilancia se destruyen disparando en un pequeño cubo que tienen arriba, luego hay otras que se destruyen acercándose y apretando la tecla “o “ letra o no numero cero, si no las destruyes tienes un soldado que va disparando a tu alrededor y puede quitarte vidas.


Luego has de derribar a los soldados enemigos disparando les a la cabeza , de ellos sale una capsula que al recogerla vas sumando puntos de este primer nivel ( en este primer nivel aun no le puesto utilidad al tema de sumar puntos pero en el segundo nivel pienso ponérsela para poder por ejemplo abrir una puerta o cambiar a otro nivel, etc etc,)

Entrando en una especie de túneles pasillos has derribar a los enemigos antes de que ellos te derriben a ti al quitarte vidas por cada uno de sus impactos, luego hay unas barreras de cemento y piedra que has de destrozar lanzando granadas o disparando, en una de ellas esta una entrada que te indicara que al atravesar seguirás en la etapa del segundo nivel del videojuego.



2 Segundo nivel descripción...jugable pero lo estoy trabajando, pasar al interior del pasillo y salir a una especie de patio donde de atrezo empiezo a poner material militar secreto, también hay enemigos que al entrar yo en el recinto me persiguen por el patio e de derribar los antes que lo agan ellos conmigo...y de momento asta aquí e llegado en la compilación del videojuego la 0,2,5….con tinuara…...



domingo, 14 de marzo de 2021

Modelado con blender de bomba volante de guerra mundial .

 


Modelado con blender de bomba volante de guerra mundial .

Paso aquí un adelanto de parte del atrezo que voy a poner en mi videojuego, una captura de video rápida de la construcción con blender de una bomba volante, sera parte del argumento del videojuego que aun no pienso desvelar…...¡¡¡¡¡Sorpresa……..para mas adelante!!!!!

Un resumen muy rápido, duplicar el cono construir unos cubos darles forma de ala, unir todos los elementos , texturizar, guardar los archivos de textura y exportar el modelado a formato fbx, y pasárselo a Unity arrastrándolo a la carpeta “gráficos” donde guardo la mayoría de gameobjets.


 

¿Como estoy haciendo los cambios de niveles en Unity?

 


Cambiando de nivel…si funciona,el cambio de armas no me da resultado, en versión web no funciona, así que seguramente aprovechare el cambio de escena o nivel al atravesar una puerta o túnel o recinto para hacer ala vez un posible cambio de armas del player y de paso el cambio de nivel me produce, como diría psicológicamente como un descanso en el trabajo del proyecto, porque seria como iniciar un nuevo proyecto, nuevos enemigos nuevas, situaciones nuevos decorados,,,,la monotonía aburre siempre lo mismo siempre lo mismo cansa en el desarrollo y cansa en el posible jugador del videojuego…..¿como estoy haciendo los cambios de niveles?


De paso decir que una inteligente combinación de cambios de escenas o de nivel hacen descansar la memoria de una forma considerable y que el juego fluya sin colgarse a la mitad…..

pongo a continuación el script que produce el cambio de escena, este se le pone al player protagonista del videojuego, cuando hace contacto con un gameobject que esta nombrado con el tag “pasa” hace el cambio de escena o de nivel…..


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

public class portagaintrotercera : MonoBehaviour {

void Start () {

}




//void OnCollisionEnter (){


void OnCollisionEnter (Collision collision)
{
//if (collision.gameObject.tag == "maloazul (4)") {
//Destroy (gameObject, 0.0f);


if (collision.gameObject.tag == "pasa") {
//Destroy (gameObject, 2.0f);

// transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
//transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

//Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
Application.LoadLevel (2);




}
}
}






jueves, 11 de marzo de 2021

cambio de arma al pasar o tocar diversos objetos del player sobre ellos, como e echo el efecto de las minas,? como e echo el efecto de muescas al impactar las balas sobre los objetos ? suelo paredes muros etc....? ¿como e echo un cambio de arma del player, el protagonista del videojuego?

 

Pequeño resumen para el blog de lo aprendido por practicas en videojuego "warlike feats, "the documents" "

impacto de balas en los objetos, pequeñas muescas que se forman en las paredes muros o suelo.

efecto de minas al pasar el protagonista del juego el player por ellas y su efecto sobre el player

cambio de arma al pasar o tocar diversos objetos del player sobre ellos, como e echo el efecto de las minas,?

como e echo el efecto de muescas al impactar las balas sobre los objetos ? suelo paredes muros etc....?

¿como e echo un cambio de arma del player, el protagonista del videojuego?


Tema 1 minas.

Primero he echo un cubo con el nombre de tag “pomada” para que el player al pasar sobre el o tocarlo active una explosión y a la vez en su marcador de vidas pierda una vida, luego e duplicado sucesivamente este cubo y los hijos se los e puesto a un padre otro cubo, el primero de la idea, para no tener que ir trasteando de uno en uno que se hace tedioso e innecesario.

Cada mina tiene un script en C# llamado Activate Trigger


using System;
using UnityEngine;
using Object = UnityEngine.Object;

namespace UnityStandardAssets.Utility
{
public class ActivateTrigger : MonoBehaviour
{
// A multi-purpose script which causes an action to occur when
// a trigger collider is entered.
public enum Mode
{
Trigger = 0, // Just broadcast the action on to the target
Replace = 1, // replace target with source
Activate = 2, // Activate the target GameObject
Enable = 3, // Enable a component
Animate = 4, // Start animation on target
Deactivate = 5 // Decativate target GameObject
}

public Mode action = Mode.Activate; // The action to accomplish
public Object target; // The game object to affect. If none, the trigger work on this game object
public GameObject source;
public int triggerCount = 1;
public bool repeatTrigger = false;


private void DoActivateTrigger()
{
triggerCount--;

if (triggerCount == 0 || repeatTrigger)
{
Object currentTarget = target ?? gameObject;
Behaviour targetBehaviour = currentTarget as Behaviour;
GameObject targetGameObject = currentTarget as GameObject;
if (targetBehaviour != null)
{
targetGameObject = targetBehaviour.gameObject;
}

switch (action)
{
case Mode.Trigger:
if (targetGameObject != null)
{
targetGameObject.BroadcastMessage("DoActivateTrigger");
}
break;
case Mode.Replace:
if (source != null)
{
if (targetGameObject != null)
{
Instantiate(source, targetGameObject.transform.position,
targetGameObject.transform.rotation);
DestroyObject(targetGameObject);
}
}
break;
case Mode.Activate:
if (targetGameObject != null)
{
targetGameObject.SetActive(true);
}
break;
case Mode.Enable:
if (targetBehaviour != null)
{
targetBehaviour.enabled = true;
}
break;
case Mode.Animate:
if (targetGameObject != null)
{
targetGameObject.GetComponent<Animation>().Play();
}
break;
case Mode.Deactivate:
if (targetGameObject != null)
{
targetGameObject.SetActive(false);
}
break;
}
}
}


private void OnTriggerEnter(Collider other)
{
DoActivateTrigger();
}
}
}



que al tocarlas el player provoca el cambio de esta por un efecto de explosión, es muy importante que cada pieza de mina este nombrada con el tag de “pomada” por que el player tiene un script en C# llamado restavida



using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class restavida : MonoBehaviour {


// Create public variables for player speed, and for the Text UI game objects
public float speed;
public Text countText;
public Text winText;

// Create private references to the rigidbody component on the player, and the count of pick up objects picked up so far
private Rigidbody rb;
private int count;/// <summary>



// At the start of the game..
void Start ()
{

rb = GetComponent<Rigidbody>();

// Set the count to zero
//count = 0;////original
count = 10;
// Run the SetCountText function to update the UI (see below)
SetCountText ();

// Set the text property of our Win Text UI to an empty string, making the 'You Win' (game over message) blank
winText.text = "";
}


void OnTriggerEnter(Collider other)
{


if (other.gameObject.CompareTag ("pomada")){

other.gameObject.SetActive (false);///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Add one to the score variable 'count'
//count = count + 1;//////original
count = count - 1;

SetCountText ();
}
}

// Create a standalone function that can update the 'countText' UI and check if the required amount to win has been achieved
void SetCountText()
{


// countText.text = "VIDAS: " + count.ToString ();///original
countText.text = "VIDAS: " + count.ToString ();
// Check if our 'count' is equal to or exceeded 12
//if (count >= 10) ////original
if (count <= 1)

//if (count >= 99)
{
// Set the text value of our 'winText'
winText.text = "TE HAN MATADO";

//Destroy (gameObject, 1.2f);
Application.LoadLevel (1);


}
}
}







que tiene el tag nombra el tag de “pomada” para ir restando vidas al player asta hacer el cambio de gameobject del player el protagonista del videojuego desvaneciéndose en el suelo.



Mismo tag “pomada” que produce el sonido de muerte o desvanecimiento del player, en este script en C#


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

public class SUENAALPERDERUNAVIDA : MonoBehaviour {

public AudioSource tickSource;

void Start () {

tickSource = GetComponent<AudioSource> ();



}

void Update () {
}



void OnTriggerEnter(Collider other) {
if (other.gameObject.CompareTag ("pomada")){


tickSource.Play ();



}}

}




Tema 2 muescas de balas en muros.

Aquí el proyectil que lanza el player esta nombrado con el tag "balaamericano" y el proyectil tiene este script en c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SANGRABALAAMERICANOELENEMIGO : MonoBehaviour {


public Rigidbody Sphere;
public float velocidad = 10f;
void disparador () {
Rigidbody SphereClon = (Rigidbody) Instantiate (Sphere, transform.position, transform.rotation);
SphereClon.velocity = transform.up * velocidad;


}

// Update is called once per frame
void Update () {


}

void OnTriggerEnter(Collider other) {

if (other.gameObject.CompareTag ("balaamericano")){

disparador ();///////////////////////////imbento yo


}}
}



A este script hay que arrastrarle en una casilla vaciá el gameobject que queremos se produzca cuando la bala toque otro objeto, yo e puesto unos cubos pequeñitos de los que sale humo….

Tema 3 cambio de armas…...continuara este me lo tengo que trabajar y estudiar mas porque en la versión web no me funciona al ser compilado aunque si funciona en la descargable para jugar desde este….continuara , paso el enlace de esta versión la 0,2,2 para que veáis lo aprendido practicado….