Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

C# is a multi-paradigm, managed, strongly typed, garbage-collected, programming language created by Microsoft in conjunction with the .NET platform.

0
votes
0answers
23 views

Performant Fog-of-War With Sight Blocking in Unity

In games like Command & Conquer or Age of Empires, players can't see all of the map. Terrain and enemies are revealed only when the player has soldiers nearby. As I understand it, the most ...
0
votes
0answers
7 views

Unity working with Async and Await in Firebase

I'm implementing a little game with Unity which use firebase services. I had a little problem with Firebase RealtimeDataBase. I have a method "UpdateScoreAsync", this method publish the new player's ...
0
votes
0answers
21 views

Why I'm getting sometimes exception null on Edge.cs in the editor?

I have windows 10 and using unity version 2018.1.6f1 Personal I have this script in the editor folder: ...
0
votes
0answers
18 views

How to render 3d objects over uGUI

I have scene with 3d objects but need uGUI as background. is this possible ?
0
votes
0answers
28 views

Calculating Path of a character around stationary objects (2d object)

How would I go about calculating a path for a character around stationary objects? Any advice is greatly appreciated. blue = character; red = stationary objects; green X = destination; 2d Game in ...
0
votes
0answers
18 views

Tetris like rotation with a list of points

I have a list of points that I want to rotate around the origin by 90, 180 or 270 degrees. This list can be an arbitrary shape such as: ...
0
votes
0answers
26 views

Why is my menu highlighting script/animation running so slow?

Alright, so bear with me as I have only been using Unity/C# for a month or so. I am currently attempting to make my own menu system for a 2D RPG, and have created a system where three options pop up ...
0
votes
3answers
40 views

Public value null after assigning it from a different script

Hello I am a beginner in Unity and still currently exploring with scripts. So I ran into a problem. In FetchAndAssign.cs Script ...
0
votes
2answers
37 views

How should I store and load structures for 2d tile based game?

I am working on structure generation for my 2d tile based game. Structures can be anything from houses, castles, dungeons, mazes etc. Structures are pre-defined, meaning I defined the width/height of ...
0
votes
1answer
21 views

Accessing a UI Image that is a child of a GameObject?

I'm sure there is a very simple solution to this issue. I am creating a UI for a 2D RPG in Unity. I have a Canvas with a two GameObjects: DialogManager & MenuManager The Dialog Manager has a ...
0
votes
0answers
14 views

Unity not loading png created with external program at runtime

I'm trying to work out why the png files I am trying to load from streaming assets are only coming up as the ? error symbol, and having no luck. The files are png files created with an external ...
0
votes
0answers
9 views

How do I calculate the dimensions of the image in the viewport?

The Situation: I have a quad in 3D space the is texture with an image. The Problem: I need to calculate the width and height in pixels at the Z depth the quad is at.
0
votes
0answers
12 views

How can I keep my cameras synchronized in two different 3D environments?

The Situation: I have two identical controls that render an image to a quad in 3D space. The camera can move on the x, y, z axis' however the Camera position and target are always sync'd to each ...
0
votes
1answer
37 views

How to get the next line character to work in a self-typing dialog box?

With the help of a tutorial, I've created an almost successful dialog box that types itself out (just as older RPGs do, and some still do). The only problem is that I've wrapped the text so that if a ...
0
votes
1answer
31 views

Unity OnCollision2D not working

I'm new to Unity and C# (though I'm experienced in python) and I am trying to make a pong clone, I've spent ages googling and trying to fix this issue but for some reason my OnCollisionEnter2D won't ...
0
votes
0answers
32 views

How to shoot to where the player is facing in a 2D top-down mobile game? Unity C# Mobile Development

In my project, I would like to shoot bullets into the direction in which the player is facing. I made a Player GameObject with a child, BulletSpawnPoint, in which the bullet should come from. The ...
2
votes
1answer
20 views

Get the XZ to the right of a rotated point?

I need to do this entirely with math, take a look at this picture: What I'm doing is building a path finder algorithm that basically looks 30 units ahead, raycasts a few times perpendicular to the ...
0
votes
1answer
18 views

Why I cant change the GUILayout.Button color to green when click on a button?

I used a break point and it's getting to the line: style.normal.textColor = Color.green; But not changing the color of the clicked button. And there are no any ...
2
votes
2answers
60 views

Timer as part of a condition

I am using a sensor as the input to my game. When a certain level of force is exerted on the sensor, for a certain amount of time, I want the next level to be reached. How would I do this? I have ...
1
vote
1answer
61 views

Character getting slow when reached to speific path point

I have manually placed some cube on the floor and aim to walk my character on those cube as they are appearing in the hirarchey and here is the walk code. ...
0
votes
1answer
38 views

Unity override Coroutine Loop

I have problem, when i override a Coroutine loop from the base code. But it seems that it only execute once. While on the base code it does what it suppouse to do and that is execute forever. ...
1
vote
2answers
51 views

Parse JSON in Unity

I've this JSON code like below. How do I parse it to the objects on code below? ...
0
votes
1answer
31 views

how to avoid Z- axis gravity from affecting my mobile game?

I am making a mobile car game, and as it is a serious game for upper limb rehabilitation. The mobile is attached to the forearm of the patient, hence the forearm movement will move and rotate the car. ...
0
votes
1answer
24 views

How can I replace an object with a prefab so the prefab will be at the same position of the gameobject?

I have some doors in the scene, each door at another position. I took one of the doors added to it a light and made a prefab of the door. Now I want to replace all the other doors with the prefab. ...
0
votes
1answer
33 views

Keeping instantiated grid in the centre of the screen?

everyone, I'm making a mobile game and I need help. In the game, I instantiate a grid of dots as seen in the first attached file below. My problem is the grid is not in the centre of the screen I ...
1
vote
1answer
25 views

Unity c#: How to slow down rotation over time?

I am making a space combat game, in which the player can press q and e to roll their ship. I did this by adding torque to the rigid body when the player press q or e. However, after they do so, they ...
0
votes
1answer
16 views

moving ball on spawn

I'm working on some special pick ups on an arkanoid-like game. Currently, I have one that should spawn several balls all in a row, right after the original ball hits the paddle. All the additional ...
1
vote
1answer
38 views

How to select two different instances in Unity C#

I have 2 Balls, 2 Nodes, and 1 Hand. I can pick up a ball, send it to a Node, grab it, put it on another Node, but I can't grab any other balls. The problem is that the Ball is defined publicly in ...
0
votes
0answers
16 views

Why the camera is not moving to the door in the middle height and getting each door to it's lower part?

Each door tagged as Waypoint. Example of a door. All the doors Y position is 0 and Y scale is 1. The doors at position 0 height 0 but the floor the door is on might be a big higher or lower at the ...
0
votes
0answers
11 views

Issue with Monogame Skybox [duplicate]

I'm new to 3D graphics and I was following one of the RBWhitaker's tutorials on setting up a skybox for a 3D XNA game. I think it was slightly outdated. The original code was something like: ...
0
votes
2answers
16 views
0
votes
2answers
50 views

How to destroy an object, and then instantiate it again later?

I'm creating an enemy spawner in Unity (2D). At long last, I have something that is quite close to working, but the problem is that I want it to destroy all instances of the enemy when the player can ...
0
votes
2answers
31 views

IndexOutOfRangeException: Array index is out of range even though the inspector clues otherwise

I am currently making a randomized infinite platform with GameObject already made platforms in 3 arrays. In the inspector everything is obviously running quite smoothly but I keep weirdly keep getting ...
0
votes
1answer
25 views

How to implement the seek steering behavior in Unity3d?

Following this tutorial: Understanding Steering Behaviors: Seek, I tried to add seek and steering behavior to my Unity prototype but it's not working this is my script. The cube does not steer it just ...
0
votes
1answer
30 views

Debug.DrawRay() does not draw rays in game view

Here is the relevant code: ...
0
votes
0answers
14 views

Unity3D: Accessing the Animator from an attached to a state StateMachineBehaviour

So, basically, I have a GameObject, this GameObject has an attached MonoBehaviour and an Animator. It has a StateMachineBehaviour, and my idea was having the StateMacineBehaviour calling one of the ...
0
votes
1answer
69 views

How Can I Fix Where The Tile Spawns?

I am making a 3D game in Unity and C#. I want to spawn another tile when the player is at the end of the current tile. But when I spawn the next tile it doesn't spawn at the right place(just after the ...
1
vote
2answers
26 views

Why when I change some values of propertie in the inspector of my script it's highlightnig the text?

A simple script that attached to a GameObject in the Hierarchy: First the variable in the editor in the inspector of the script Speed Change Wait was highlighted I mean it's much black painted then ...
0
votes
0answers
22 views

Creating a DirectX 11 Render Target crashes when a video recording tool is running

A player told me he wanted to make a video of my game, but when he starts the game it crashes every time. I bought the same video recording tool he is using to test it myself. I could reproduce the ...
0
votes
1answer
13 views

Player with navmeshagent keeps moving back to the last mouse position clicked

On my FPSController I have two scripts, Player Controller and Agent Controller. Player Controller is for using the keys WSAD for moving the player around. Agent Controller uses a NavMeshAgent to ...
1
vote
1answer
36 views

Transforming a 2D Grid in 3D Space

Hi everyone, I'm trying to implement a 2D Grid in a simple 3D Editor. Here are some debug-rays I already implemented: Everything is working as intended as long as the object is not rotated. For ...
0
votes
0answers
17 views

Design Pattern for Firebase with Unity:

I'm implementing a game with Unity and Firebase. I'm using Authetication, Database and Analytics services from Firebase. I'm using 3 interfaces, one per service, to permit the code be independient ...
0
votes
0answers
29 views

How can I move a camera like a navmeshagent in baked areas?

I have a space station with rooms and doors. Now the waypoints script will make the camera move to the waypoints with smooth rotation. But I want that the camera will move on the baked areas like a ...
1
vote
0answers
13 views

Unity build trying to include Editor Scripts

I'm having a peculiar problem. I'm creating a 2D Unity game using Fungus for cutscenes and the Unity Test Tools for unit testing. The game runs fine in the editor, but when I try and build an ...
1
vote
0answers
40 views

Player Object is interacting backwards, how do I fix it?

So when my player interacts with an object which the key is right click. For some reason I have no idea for the player model walks backwards. There isn't any error in the console but it is really ...
0
votes
1answer
61 views

How can I fix “MissingReferenceException: The object of type 'Text' has been destroyed but you are still trying to access it”?

I am making a 3D game in Unity in C#. I have added an IAP so the user can buy some coins and I have also added a label so the user can see how many coins he has. But when I click on the restart button ...
0
votes
0answers
22 views

Monogame Skybox Advice

so I'm pretty new to 3D graphics and I was following one of the RBWhitaker's tutorials on setting up a skybox for a 3D XNA game. I think it was slightly outdated. In my .fx file for the skybox I did ...
1
vote
0answers
21 views

Why the main menu is not working on the second time when pressing on escape key to back to the main menu?

I have two scenes. Main Menu and the main scene. The game start when only the main menu is loading. When I click on the New Game button it's loading the main scene and removing the main menu scene. ...
0
votes
5answers
187 views

Spell casting in a Turn based game

I'm trying to make a start on a Spell/Skill system similar to a Moba or MMO from my project where you would press the skill button and see what type of targeting it has then aim (either in an area or ...