SchultzGames
Para tirar dúvidas, crie um tópico especifico na área "Dúvidas em Geral" e aguarde ser respondido. Evite comentar em tópicos não relacionados a sua dúvida :D
TÓPICOS RECENTES:
Tópico:
Postado em:
Postado por:
ShapeKeys do Blender para a Unity altera áreas próximas
COMO EVITAR QUE UM OBJETO (PLAYER,ITEM ETC...) ATRAVESSE UMA PAREDE.
Ajuda em Script de Verificação de Ação e Reação
unity Failed to load PlayerSettings (internal index #0). Most likely data f
modelar avatar e skins para um jogo web
PRECISO FAZER QUE MEU GAME FIQUE ONLINE
Materiais do Blander não aparecem no MeshRendere do Objeto na Unity
Repetiçoes de Textura no Terreno
SERVER IS DOWN - UNITY+MSQL
Procuro programadores - Novo jogo
Problema com o MS VEHICLES
Preciso de ajuda com a Unity
Problema com vídeo em 360° na Unity
Problemas no MS Vehicles
unity- eventos na Animação com Armature/Bones vinda do blender não funciona
ajuda exibir resultados simulados em uma liga Game Unity
Unity - ParticleSystem não é redirecionado no rawimage no canvas
Como resolver o problema de "face orientation" no Blender.
[DÚVIDA] Tive um problema com meu Canvas
erro na Directional Light
Problemas com o Directional Light da Unity 3D
210 Linhas de código para inimigo é muito grande?
Novo jogo da franquia Sphere game em desenvolvimento
malha da roda não girando com wheel collider unity
Problemas com ambiguidade
Touch mobile
INVALID TOKEN
Como acessar o "HD Render Pipeline" do HDRP por script?
CHAT GPT PRA JOGO DE TIRO? comentem
Tutorial script inimigo segue e foge do player
Ainda vale a pena lançar Asset na Asset Store?
Ajuda com tabela de historico de pontuaçao.
[TUTORIAL] Entrar no carro estilo GTA
Como derrapar um Whell Collider
Como altertar o valor do "Asymptote Value" do Whell Collider via Script
Preciso de ajuda para substituir valor de variavel em outro script
Ajuda com Top Down Shooter utilizando Photon
Duvida com Netcode
[RESOLVIDO] Unity - Movendo a Câmera na Horizontal/Vertical com Touch
Alguém me ajuda com os anúncios pfv
Segundo Trailer do jogo Dark Age, Feliz Natal a todos!
Unity - ScrollRect, Viewport, Content - O Conteúdo ñ inicia no topo
Coleta de itens
Unity - Cadastro do email do jogador
[GRATIS] PACK DE MODELOS 3D PARA JOGO DE TERROR
Onde Conseguir músicas para meu Jogo?
error CS0246 em Script
Alguem teve ja esse problema?
[Projeto em Andamento] Draug, um jogo de hordas
DISPONIVEL PARA FAZER MODELOS 3D
Unity-Loja.Como os Jogadores terão acesso aos ítens comprados na PlayStore?
Bugando depois do Build.
Primeiro Trailer do jogo Dark Age
Problema com sombra
Mesh e Material do objeto trocando para uma instancia no inicio do jogo
[RESOLVIDO] Unity - RawImages_Layer_Camera
INVESTIMENTO EM JOGOS E BANCO DE TALENTO
Teaser do meu novo projeto pessoal, Dark Age
Preciso de ajuda com mudança para mobile androide.
[RESOLVIDO] Posição final do objeto em jogo 2D
Input.GetAxis() obedercer a orientação de um objeto.
Interação com elementos UI
Meu primeiro jogo na steam
Minimap/Radar/GPS Estilo GTA V
[RESOLVIDO] Erro no console depois que formatei o pc
PACK GRÁTIS de Músicas ELETRÔNICAS para ajudar vocês em seus Jogos Indies!
[TUTORIAL] Entenda como funciona: ENUM, SWITCH, BREAK, CASE no C#
O Labirinto II - Baixe o Jogo
Qual e o codigo de Botões na unity para saber seus estados?
Como carregar itens pequenos dentro do carro sem que atravesse os colliders
[Duvida] Script pegar itens
Travamento ao trocar de cena
Colisão zoada e movimentação
Salvar objetos que foram destruidos entre cenas na unity
Quero começa a desenvolver um jogo de luta porem eu queria aprender a faze
Pegar qual objeto colidiu com o Linecast.
movimentação e camera?
[RESOLVIDO] Unity - SceneManager.LoadScene abre scene com objeto "vazio"
[RESOLVIDO] ajuda sobre skybox
MEU SIMULADOR DE CARRO
[_____IMPORTANTE_____] ALTERAÇÕES NA POLÍTICA DE COBRANÇA DA UNITY
[RESOLVIDO] Ausencia da funçao NavMesh na Unity 2022.2.12
[_____IMPORTANTE_____] ALTERAÇÕES NA POLÍTICA DE COBRANÇA DA UNITY - 2
Roll Up Um jogo de aventura e desáfios
Terminologia da Unity em outras engines
Como criar a iluminação do Sol no Sistema Solar?
Conexão de lobby pelo OnConnectedToMaster
Problema na exportção de projeto unity
[RESOLVIDO] Unity - Áudios estão emitindo som só Depois do Botão ser solto
Unity - Banco de Dados Online junto ao Jogo
Player virar para o inimigo(Prefab)
[TUTORIAL] Sistema De Save Game Ao Sair Da Fase
Problema de Sincronização de um objeto de um jogo multiplayer usa q Photon
Unity - Compartilhar meu Jogo
Alguém que manja do Google ADmob?
Unity - Avaliar meu Jogo
[RESOLVIDO] Destruir inimigo com o player.
Salvar e carregar dados na Unity de objetos prefabs sem sobrescrever os dad
Unity - Salvar os Dados do Jogador Online
Ontem à(s) 10:09 pm
Dom Mar 10, 2024 2:30 pm
Sex Mar 01, 2024 1:27 pm
Qui Fev 22, 2024 9:57 pm
Qua Fev 21, 2024 10:39 am
Ter Fev 20, 2024 9:28 am
Ter Fev 20, 2024 12:15 am
Seg Fev 19, 2024 1:06 pm
Seg Fev 12, 2024 1:56 pm
Seg Fev 12, 2024 1:17 pm
Dom Fev 11, 2024 8:55 pm
Dom Fev 11, 2024 11:16 am
Seg Fev 05, 2024 4:18 pm
Dom Fev 04, 2024 9:39 pm
Qua Jan 31, 2024 11:59 pm
Ter Jan 30, 2024 7:37 pm
Ter Jan 23, 2024 6:33 pm
Dom Jan 21, 2024 6:03 pm
Sáb Jan 20, 2024 7:03 pm
Sáb Jan 20, 2024 6:58 pm
Sáb Jan 20, 2024 6:39 pm
Sex Jan 19, 2024 1:29 pm
Sex Jan 19, 2024 8:40 am
Dom Jan 14, 2024 5:30 pm
Qua Jan 10, 2024 10:29 pm
Qua Jan 10, 2024 8:55 pm
Qua Jan 10, 2024 7:14 pm
Ter Jan 09, 2024 3:55 pm
Ter Jan 09, 2024 8:04 am
Sáb Jan 06, 2024 8:02 pm
Sex Jan 05, 2024 7:01 am
Sex Jan 05, 2024 12:12 am
Qui Jan 04, 2024 6:55 pm
Qui Jan 04, 2024 12:52 pm
Qui Jan 04, 2024 4:34 am
Ter Jan 02, 2024 11:48 pm
Dom Dez 31, 2023 7:25 pm
Qua Dez 27, 2023 5:44 pm
Qua Dez 27, 2023 3:08 pm
Sáb Dez 23, 2023 7:27 pm
Sáb Dez 23, 2023 5:06 pm
Qui Dez 21, 2023 8:10 pm
Seg Dez 18, 2023 2:04 pm
Sex Dez 15, 2023 5:11 pm
Qui Dez 14, 2023 9:13 pm
Qui Dez 14, 2023 2:47 pm
Qui Dez 14, 2023 1:48 pm
Qua Dez 13, 2023 8:58 pm
Ter Dez 12, 2023 2:32 pm
Seg Dez 11, 2023 1:53 pm
Qua Dez 06, 2023 8:13 pm
Sáb Dez 02, 2023 8:06 pm
Qui Nov 30, 2023 7:49 am
Seg Nov 27, 2023 1:35 am
Qua Nov 22, 2023 7:37 am
Qui Nov 09, 2023 1:22 pm
Seg Nov 06, 2023 11:59 am
Ter Out 31, 2023 9:53 am
Dom Out 29, 2023 8:05 pm
Dom Out 29, 2023 3:03 am
Sex Out 27, 2023 3:43 pm
Sex Out 27, 2023 3:28 pm
Qua Out 25, 2023 1:20 pm
Seg Out 23, 2023 10:34 am
Dom Out 22, 2023 6:55 pm
Qui Out 19, 2023 11:57 pm
Qui Out 19, 2023 6:39 pm
Ter Out 17, 2023 6:37 pm
Ter Out 17, 2023 6:18 pm
Seg Out 16, 2023 1:59 pm
Sáb Out 14, 2023 12:15 pm
Qua Out 11, 2023 6:07 pm
Seg Out 09, 2023 4:19 pm
Qua Out 04, 2023 12:12 pm
Qua Out 04, 2023 12:11 pm
Ter Out 03, 2023 9:18 pm
Ter Out 03, 2023 9:08 pm
Ter Out 03, 2023 6:05 pm
Ter Set 26, 2023 12:45 pm
Seg Set 25, 2023 9:02 pm
Seg Set 25, 2023 9:47 am
Sáb Set 23, 2023 2:10 pm
Sex Set 22, 2023 9:01 pm
Qui Set 21, 2023 11:04 am
Qua Set 20, 2023 4:40 pm
Qua Set 20, 2023 9:15 am
Dom Set 17, 2023 12:17 pm
Sex Set 15, 2023 7:24 pm
Sex Set 15, 2023 5:41 pm
Sex Set 15, 2023 4:28 pm
Sex Set 15, 2023 10:56 am
Sex Set 15, 2023 10:15 am
Seg Set 11, 2023 11:43 am
Seg Set 11, 2023 11:31 am
Sáb Set 09, 2023 4:53 pm
Sáb Set 09, 2023 1:44 pm
Ter Set 05, 2023 11:12 pm
Ter Set 05, 2023 3:12 pm
Seg Set 04, 2023 11:53 pm



































































































TESTE inimigo anda por um trajeto definido, para ao ser iluminado, e segue seu caminho

2 participantes

Ir para baixo

DÚVIDA TESTE inimigo anda por um trajeto definido, para ao ser iluminado, e segue seu caminho

Mensagem por Giulyo Ter Abr 18, 2017 5:07 pm

Olá!

Eu tava caçando um jeito de fazer um inimigo andar por determinado percurso, parando e olhando para cada direção, além disso, ele deveria parar quando colidisse comigo a um metro de distancia e eu acendesse a luz da lanterna. Achei um script de waypoints que me ajudou muito (coloco abaixo traduzindo os coments, pode ser útil para mais alguem ou servir de base para algo.). Traduzi o que pude, certas partes foram dificeis por causa do meu conhecimento tacanho em programação. Mas traduzi e resolvi postar, como agradecimento a ajuda que ja recebi do forum (e dos tutoriais que vi daqui)
Como eu faria, para adicionar no script abaixo, o efeito de parar o inimigo (apenas dentro de 1 metro de distancia do meu jogador) ao acender a luz (pondo no script o mesmo botão que uso para ligar a lanterna), e ao sair dessa area, ele volta a se mover, seguindo o percurso?

Alguem pode me dar uma luz?

Código:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Movimentação : MonoBehaviour
{
 //   This is a very simple waypoint system.
 //Este é um sistema simples de Waypoints
 // Each bit is explained in as much detail as possible for people (like me!) who need every single line explained.
 //Cada parte é explicada com o máximo de detalhes possivel para pessoas (como eu) que precisam entender cada linha descrita
 // As a side note to the inexperienced (like me at the moment!), you can delete the word "private" on any variable to see it in the inspector for debugging.
 //Como um conselho para pessoas sem experiência, como eu, você pode deletar a palavra "private" de qualquer variável para vê-la no inspector para debugar.

 // I am sure there are issues with this as is, but it seems to work pretty well as a demonstration.
 //Eu estou certo de que há problemas com o código como ele é, mas serve bem como demonstração (para mim serviu como uma luva...)

 //STEPS: Passos
 //1. Attach this script to a GameObject with a RidgidBody and a Collider.
 //1. Coloque este script a um gameobject com rigidbody e collider
 //2. Change the "Size" variable in "Waypoints" to the number of waypoints you want to use.
 //2. Mude o "Size" (tamanho) das variável em "waypoints" para o número de waypoints (espécie de checkpoints no caminho) que você quer usar.
 //3. Drop your waypoint objects on to the empty variable slots.
 //3. coloque seus waypoints nos slots vazios das variáveis
 //4. Make sure all your waypoint objects have colliders. (Sphere Collider is best IMO).
 //4. Esteja certo de que todos os waypoints tem colliders (Sphere Colliders são melhores)
 //5. Click the checkbox for "is Trigger" to "On" on the waypoint objects to make them triggers.
 //5. Marque a caixa de "is trigger" como "on" em todos os objetos de waypoints
 //6. Set the Size (radius for sphere collider) or just Scale for your waypoints.
 //6. Coloque o tamanho (raio para o sphere collider) ou apenas ajuste a escala
 //7. Have fun! Try changing variables to get different speeds and such.
 //7 Divirta-se! Tente mudar as variáveis para ter diferentes velocidades e etc.

 // Disclaimer:
 // Extreeme values will start to mess things up.
 // Maybe someone more experienced than me knows how to improve it.
 // Please correct me if any of my comments are incorrect.

 // This is the rate of accelleration after the function "Accell()" is called.
 //Esta é a taxa de aceleração depois que a função "Acell()" é chamada
 // Higher values will cause the object to reach the "speedLimit" in less time.
 //Altos valores farão o objeto alcançar a velocidade máxima mais rapidamente
 public float accel = 0.8f;

 // This is the the amount of velocity retained after the function "Slow()" is called.
 //Esta é a quantidade de velocidade retida após a função "slow()" ser chamada
 // Lower values cause quicker stops. A value of "1.0" will never stop. Values above "1.0" will speed up.
 //Valores menores causam paradas mais bruscas um valor de "1.0" fará nunca parar. Valores acima de "1.0" vão acelerar o objeto
 public float inertia = 0.9f;

 // This is as fast the object is allowed to go.
 //Esta é a velocidade máxima do objeto
 public float speedLimit = 10.0f;

 // This is the speed that tells the functon "Slow()" when to stop moving the object.
 //Esta é a velocidade que diz a função "slow()" quando parar o objeto
 public float minSpeed = 1.0f;

 // This is how long to pause inside "Slow()" before activating the function
 //Aqui é quanto tempo de pausa há em "Slow()" antes de chamar a função
 // "Accell()" to start the script again.
 //"ACell()" para recomeçar o script
 public float stopTime = 1.0f;

 // This variable "currentSpeed" is the major player for dealing with velocity.
 //Esta variável "current speed" é a forma principal de se lidar com a velocidade
 // The "currentSpeed" is mutiplied by the variable "accel" to speed up inside the function "accell()".
 //"currentSpeed" é multiplicado pela variável "acell" para aumentar a velocidade dentro da função "Acell()"
 // Again, The "currentSpeed" is multiplied by the variable "inertia" to slow
 //Novamente, "CurrentSpeed" é multiplicado pela variavel "inertia" para frear.
 // things down inside the function "Slow()".
 //Tudo ocorre dentro da função "Slow()"
 private float currentSpeed = 0.0f;

 // The variable "functionState" controlls which function, "Accell()" or "Slow()",
 //A variavel "functionState,  "Acell()" ou "Slow()"
 // is active. "0" is function "Accell()" and "1" is function "Slow()".
 //está ativa. "0" é a função "Acell()" e 1 é a função "Slow()"
 private float functionState = 0;

 // The next two variables are used to make sure that while the function "Accell()" is running,
 //As duas variáveis seguintes são usadas para ter certeza que  enquanto a função "Acell()" está em uso,
 // the function "Slow()" can not run (as well as the reverse).
 //A função "Slow()" não pode funcionar (e vice-versa)
 private bool accelState;
 private bool slowState;

 // This variable will store the "active" target object (the waypoint to move to).
 //Esta variável irá guardar o objeto alvo ativo (o waypoint ao qual o objeto irá se mover)
 private Transform waypoint;

 // This is the speed the object will rotate to face the active Waypoint.
 //Esta é a velocidade que o objeto irá rotacionar para ir ao proximo waypoint
 public float rotationDamping = 6.0f;

 // If this is false, the object will rotate instantly toward the Waypoint.
 //Se esta for falsa, o objeto irá rotacionar instantaneamente para o waypoint
 // If true, you get smoooooth rotation baby!
 //Se for verdadeira, ele terá uma suaaave rotação
 public bool smoothRotation = true;

 // This variable is an array. []< that is an array container if you didnt know.
 //Esta variavel é uma matriz. []< Este é um conteiner de matriz se você não sabe.
 // It holds all the Waypoint Objects that you assign in the inspector.
 //Ele guarda os waypoints que você define no inspetor
 public Transform[] waypoints;


 // This variable keeps track of which Waypoint Object,
 //Esta variável mantém o controle de qual waypoint,
 // in the previously mentioned array variable "waypoints", is currently active.
 //na variavel de matriz mencionada anteriormente, esta atualmente ativa
 private int WPindexPointer;


 // Functions! They do all the work.
 // You can use the built in functions found here: [url]http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.html[/url]
 // Or you can declare your own! The function "Accell()" is one I declared.
 // You will want to declare your own functions because theres just certain things that wont work in "Update()". Things like Coroutines: [url]http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield.html[/url]

 //The function "Start()" is called just before anything else but only one time.
 void Start( )
 {
 // When the script starts set "0" or function Accell() to be active.
 // Quando o script começar selecione "0" ou função Acell() ativa.
 functionState = 0;

 }

 //The function "Update()" is called every frame. It can get slow if overused.

 void Update ()
 {
 // If functionState variable is currently "0" then run "Accell()".
 // Se functionState  = "0", então chame a função Acell()
 // Withouth the "if", "Accell()" would run every frame.
 //Sem esse "if", a função é chamada a cada frame.
 if (functionState == 0)
 {
 Accell();
 }

 // If functionState variable is currently "1" then run "Slow()".
 // Se functionState é igual a "1", chame a função "Slow()"
 // Withouth the "if", "Slow()" would run every frame.
 //Sem esse "if" a função é chamada a cada frame.
 if (functionState == 1)
 {
 StartCoroutine(Slow());
 }

 waypoint = waypoints[WPindexPointer]; //Keep the object pointed toward the current Waypoint object.
 //Mantenha o objeto apontado para o próximo waypoint
 }

 // I declared "Accell()".
 // função "Acell()"
 void Accell ()
 {
 if (accelState == false)
 {
 // Make sure that if Accell() is running, Slow() can not run.
 //Confirmando que se Acell() esta funcionando, Slow() não pode funcionar
 accelState = true;
 slowState = false;
 }

 // I grabbed this next part from the unity "SmoothLookAt" script but try to explain more.
 //Eu peguei esta parte do script "SmoothLookAt" mas tentarei explicar mais
 if (waypoint) //If there is a waypoint do the next "if".
 //Se tiver um waypoint próximo
 {
 if (smoothRotation)
 {
 // Look at the active waypoint.
 //olhe apara o waypoint ativo
 var rotation = Quaternion.LookRotation(waypoint.position - transform.position);

 // Make the rotation nice and smooth.
 //Faça a rotação bela e suave
 // If smoothRotation is set to "On", do the rotation over time
 //Se smoothRotation estiver ligada, faça a rotação através do tempo
 // with nice ease in and ease out motion.

 transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * rotationDamping);
 }
 }

 // Now do the accelleration toward the active waypoint untill the "speedLimit" is reached
 //Agora acelere para o proximo ponto de waypoint até spedLimit ser alcançado
 currentSpeed = currentSpeed + accel * accel;
 transform.Translate (0,0,Time.deltaTime * currentSpeed);

 // When the "speedlimit" is reached or exceeded ...
 //Qaundo speedLimit é atingida ou ultrapassada...
 if (currentSpeed >= speedLimit)
 {
 // ... turn off accelleration and set "currentSpeed" to be
 //...desligue a aceleração e selecione currentSpeed para ser
 // exactly the "speedLimit". Without this, the "currentSpeed
 //exatamente a speedLimit. Sem isso, currentSpeed
 // will be slightly above "speedLimit"
 //estará levemente acima de speedLimit
 currentSpeed = speedLimit;
 }
 }

 //The function "OnTriggerEnter" is called when a collision happens.
 //A função OnTriggerEnter é chamada quando uma colisão acontece
 void OnTriggerEnter ()
 {
 // When the GameObject collides with the waypoint's collider,
 //Quando o objeto colide como colisor do waypoint
 // activate "Slow()" by setting "functionState" to "1".
 //Ativar "Slow()" colocando "functionState" = "1"
 functionState = 1;

 // When the GameObject collides with the waypoint's collider,
 //Quando o GameObject colide com o colisor do waypoint
 // change the active waypoint to the next one in the array variable "waypoints".
 //Mude o wyapoint ativo para o próximo.
 WPindexPointer++;

 // When the array variable reaches the end of the list ...
 //Quando a matriz de variaveis encontrar o fim da lista...
 if (WPindexPointer >= waypoints.Length)
 {
 // ... reset the active waypoint to the first object in the array variable
 // ... resete o waypoint para o primeiro da lista
 // "waypoints" and start from the beginning.
 //tudo volta para o começo
 WPindexPointer = 0;
 /*
 * teste: Destruir objeto ao chegar ao fim da lista
 */
 Destroy (gameObject, 1f);

 }
 }

 // I declared "Slow()".
 IEnumerator Slow()
 {
 if (slowState == false) //
 {
 // Make sure that if Slow() is running, Accell() can not run.
 accelState = false;
 slowState = true;
 }

 // Begin to do the slow down (or speed up if inertia is set above "1.0" in the inspector).
 currentSpeed = currentSpeed * inertia;
 transform.Translate (0,0,Time.deltaTime * currentSpeed);

 // When the "minSpeed" is reached or exceeded ...
 if (currentSpeed <= minSpeed)
 {
 // ... Stop the movement by setting "currentSpeed to Zero.
 currentSpeed = 0.0f;
 // Wait for the amount of time set in "stopTime" before moving to next waypoint.
 yield return new WaitForSeconds(stopTime);
 // Activate the function "Accell()" to move to next waypoint.
 functionState = 0;
 }

 //=======================================================================================
 // Espaço para o resto do script
 }

}


Eu mantive a parte em ingles, para editar depois caso encontre uma tradução melhor.

É isso, grato e abraços.

Giulyo
Iniciante
Iniciante

PONTOS : 2543
REPUTAÇÃO : 1
Respeito as regras : TESTE inimigo anda por um trajeto definido, para ao ser iluminado, e segue seu caminho WvDYdlf

Ir para o topo Ir para baixo

DÚVIDA Re: TESTE inimigo anda por um trajeto definido, para ao ser iluminado, e segue seu caminho

Mensagem por Matrirxp Ter Abr 18, 2017 6:22 pm

COMO ASSIM????
Dúvida Dúvida Dúvida
Matrirxp
Matrirxp
ProgramadorMaster

Masculino PONTOS : 3144
REPUTAÇÃO : 86
Idade : 21
Áreas de atuação : Programação: C#, Java, HLSL, CG, GLSL.
Modelagem 3D.
Respeito as regras : TESTE inimigo anda por um trajeto definido, para ao ser iluminado, e segue seu caminho Aad8pUi

https://www.youtube.com/channel/UCkngjEDMx9y_vW0t7Io05gg

Ir para o topo Ir para baixo

DÚVIDA Re: TESTE inimigo anda por um trajeto definido, para ao ser iluminado, e segue seu caminho

Mensagem por Matrirxp Ter Abr 18, 2017 6:56 pm

Código:
using UnityEngine;
using System.Collections.Generic;
using System.IO;
using System.Collections;

public class Test : MonoBehaviour {

 Light luz;
 public GameObject SpotLight;
 float campo;
 public GameObject player;

 void Start(){

 luz = SpotLight.GetComponent <Light>();

 }

 void Update(){

 campo = Vector3.Distance (transform.position, player.transform.position);

 if (campo > 1) { //Se a distancia entre o player e o objeto for maior que 1
 if(luz.enabled == true){
 // CODIGO PARA SEGUIR
 }
 }
}
 


}
Matrirxp
Matrirxp
ProgramadorMaster

Masculino PONTOS : 3144
REPUTAÇÃO : 86
Idade : 21
Áreas de atuação : Programação: C#, Java, HLSL, CG, GLSL.
Modelagem 3D.
Respeito as regras : TESTE inimigo anda por um trajeto definido, para ao ser iluminado, e segue seu caminho Aad8pUi

https://www.youtube.com/channel/UCkngjEDMx9y_vW0t7Io05gg

Ir para o topo Ir para baixo

DÚVIDA Re: TESTE inimigo anda por um trajeto definido, para ao ser iluminado, e segue seu caminho

Mensagem por Giulyo Qua Abr 19, 2017 1:24 pm

Grato mestre!

Funcionou, só precisei fazer uma leve alteração. a intenção era fazer como os Boos. um inimigo que anda, mas para ao ser visto pela lanterna. Ele só andava quando eu acendia a lanterna, mas pondo "false" no fim do seu script, resolveu. 
Ele ta parando independente da distância em que acendo a luz, Mas vou analisar isso com muita calma. Queria só agradecer pela ajuda, grato!

Giulyo
Iniciante
Iniciante

PONTOS : 2543
REPUTAÇÃO : 1
Respeito as regras : TESTE inimigo anda por um trajeto definido, para ao ser iluminado, e segue seu caminho WvDYdlf

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos