Questions tagged as 'unity3d'

2
answers

How to change ownership of another object?

I have a screen with two objects 2d: player and enemy , both are prefab of an object called fighter . They have three properties: attack , defense and hp . I created a script and included it in...
asked by 14.10.2017 / 19:20
1
answer

Unity MonoDevelop says my variables do not exist?

I was following the fourth tutorial video of roguelike scavengers , and I came across with these errors when finished. In the fifth video it fixes some, but these have continued, I'm using the latest version of unity ( 5.1f1 I do not k...
asked by 05.07.2015 / 02:18
1
answer

Unity - Error: Object reference not set to an instance of an object - Instantiate

I've done the Survival Shooter tutorial that can be found in the Unity asset store at link The game is working, but is giving this following error in the code. How do I resolve this? NullReferenceException: Object reference not set to an...
asked by 22.03.2015 / 03:26
1
answer

How to make the weapon disappear on the same key that makes it appear in UNITY

using UnityEngine; using System.Collections; public class SelecteArma : MonoBehaviour { public bool Equipamento = true; void Start () { } void Update () { if (Input.GetKeyDown ("1")) { selecionarArma (0);...
asked by 20.05.2015 / 16:12
1
answer

Problem in a Player Script PlayerMoviment on Unity 5

Problem in a Script PlayerMoviment of Char in Unity 5 Supposed problem on line 70 in "Quaternion" using UnityEngine; using System.Collections; public class PlayerMoviment : MonoBehaviour { //velocidade do Mago public float speed = 6f...
asked by 28.06.2015 / 17:08
1
answer

Print whenever variable receives a certain value

I'm developing a simple game where whenever an object exits the screen a variable named score gets +1. The idea is simple, what I'm trying to do is to print the value of the variable variable whenever the player makes 10 new points, that is,...
asked by 31.08.2018 / 18:45
1
answer

Synchronize player and host movements

Hello. I'm doing a school project and I'm following the Unity Multiplayer Netorking tutorial. Everything worked properly, however the tutorial teaches you to have a player and a host, both each with a "character" that moves independently of the...
asked by 06.02.2018 / 11:15
1
answer

AddComponent () with parameters in Unity3D?

Good morning everyone! In summary, I am trying to use "new" to build an object in Unity, but it says that it is not recommended to use new to instantiate an object and suggests using "AddComponent ()" but I am when creating a new object, 3 pa...
asked by 21.11.2017 / 12:56
1
answer

Simple C # doubt on Unity

I do not know anything about C #, but I'm trying to develop a simple project on Unity. It consists of moving a crane. I did the code to move the bridge, but if I keep holding the button it keeps moving beyond the limit. How can I limit the mo...
asked by 01.11.2016 / 10:50
1
answer

How can I by these random questions? [closed]

using UnityEngine; using UnityEngine.UI; using System.Collections; public class responder : MonoBehaviour { private int idTema; public Text pergunta; public Text RespostaA; public Text RespostaB; public Text RespostaC;...
asked by 11.04.2016 / 18:28