Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-1 votes
1 answer
625 views

The Random.Range function isn't activating when I call it. How do I get the function to work properly and call from a range of numbers?

As you can see, I'm attempting to set the random prey integer to a number within a random range like so: randomPrey= Random.Range(0,10); As I type the code out the .Range doesn't turn yellow and the ...
Gideon Falls's user avatar
0 votes
3 answers
221 views

Respawn Player to Respawn point when colliding with a Hazard

I have grid movement set up for the player within a set space. The player moves one unit at a time and can move several units when holding down a direction key. I would like the player to respawn back ...
Natalia DaLomba's user avatar
0 votes
2 answers
780 views

Determine line that threw an Exception using Android Logcat

I just installed Android logcat to debug my game from Unity's package manager. I don't fully understand how it works or in what order the logs are shown relative to my code. The problem I have is that ...
Gozmetaiemax's user avatar
0 votes
1 answer
127 views

Help with moving object to mouse position

I'm trying to make an object follow my cursor using raycasting. I'm creating the raycast each frame and checking the player's distance from the hit and whether or not the hit landed on an object ...
Alex Carr's user avatar
0 votes
1 answer
2k views

Unity build does not launch and leaves no logs/errors

I have released my first title Audio Infection ( https://store.steampowered.com/app/911580/Audio_Infection/ ) for a bit over a year ago. Recently 1 user has so far encountered an issue where the game ...
ploopploop's user avatar
0 votes
2 answers
149 views

objects disappear before time

I created a little pool in order to better manage my enemies, to which, an enemySpawner object calls to retrieve a clone and show it on screen ...
CJLopez's user avatar
  • 113
0 votes
0 answers
37 views

How can I debug my game on mobile device?

I've been creating this game on my computer for months and everything works fine. But when I built the project and installed it into my android device, it doesn't run as smoothly. I don't wanna use ...
Muhammad usman's user avatar
-1 votes
1 answer
111 views

Player light color he collects before checkpoint is getting reset when he restarts at checkpoint

I have a child object for my player called Light. The light color changes when the player touches balls of different colors. When I respawn at a checkpoint, the light is getting reset to the default ...
Mr.gon96's user avatar
0 votes
1 answer
675 views

Instantiate an object and translate it randomly

My goal through this code in C # is that each time the player presses the Q I create a cube at a fixed position given by another object, then begin translating it in a random direction. ie. first ...
kaloprat's user avatar
  • 111
2 votes
1 answer
143 views

Can I run a script and generate warning when Unity project is saved?

Context: I'm working with Unity using Git and we have .gitignore setup so that we could create "_local" folder anywhere in Assets and it won't be commited. It makes for kind of a Debug/Backup folder, ...
Elgirhath's user avatar
  • 209
0 votes
1 answer
121 views

Verifying that two words match — false negatives

In my first game, I am trying to validate whether two words match: whether an input word matches a reference word from an array. Unfortunately the only word for which it finds a correct match is the ...
Rolenz Pangan's user avatar
2 votes
1 answer
62 views

Piece of code causes game to freeze, then keep playing after sometime

Games Basic Premise Ball rolls along procedurally generated path. Click to changer directions. Don't fall off. I have a script dedicated to the path. The path is made up of 20 cubes, along the x+ and ...
Headless Dev's user avatar
0 votes
2 answers
223 views

NullReferenceException in my inventory system [duplicate]

I'm making a simplified inventory system for a 3d game. When I try to pick up an object, I get the following error: NullReferenceException: Object reference not set to an instance of an object ...
Indiepixel's user avatar
2 votes
0 answers
1k views

The identifier is not in the scope! [closed]

I have a typical foreach loop in a coroutine like: ...
Henjin's user avatar
  • 415
0 votes
0 answers
27 views

How to make Unity NullReferenceExceptions more informative

Is there a way to modify the NullReferenceException for Unity gameObjects so that not only does it say "object reference not set to an instance of an object," but also says exactly what the name of ...
reincarnationofstackexchange's user avatar
1 vote
1 answer
2k views

Why does the Debug.DrawRay return these weird lines

I am working on a small feature of a 2D mobile game where a indicator points towards a object in 2D space. I am trying to make the indicator turn towards the object, however the vector I am trying to ...
Milan's user avatar
  • 113
1 vote
1 answer
2k views

How to generate a log file from a Unity WebGL build?

I want to create a log file for every time my WebGL game is played and have the errors and warnings with detail in there. I know how to make the log file I just don't know how to get the errors and ...
Henjin's user avatar
  • 415
0 votes
1 answer
390 views

Unity TopDown parallax effect only working in three of four directions

I'm a hobbyist at programming so I'm sure I'm missing something very simple: Basically I have a script that has a method for repositioning a 3x3 grid of tiles every time the player goes out of the ...
Dbilyk's user avatar
  • 33
2 votes
3 answers
4k views

Unity get more than 2 lines of log height

Unity does only display 2 lines in height for each log, at least with the default settings. I couldn't find a menu, where I could change this. I want to display a matrix, and I need to see the log ...
TobiasW's user avatar
  • 987
0 votes
1 answer
288 views

When using Unity 5, is there a way to print/save/identify the last n lines of code that were executed at a specific point?

So, here is what I am after. Is there a way to identify which were the last n lines of code that were executed in Unity 5 (with C#) at a given point of the game? I know I can use Debug.Break() to set ...
Kim Shutter's user avatar
2 votes
1 answer
261 views

In Unity, why does my IndexOutOfRange exception disappear when trying to debug it?

I don't get errors when playing from Unity "Game" tab. But when I build an executable (development or not) it stucks. I get "IndexOutOfRange" exception. Which also magically disappears (yes) when I ...
freesoul's user avatar
  • 393
1 vote
1 answer
39 views

Function messages wont send when identical conditions will message to activate another function

So in working with my game, there aren't any syntax or compile errors, but there's this one bug that I've been working on to fix for a few days on and off and I can't seem to make heads or tails of ...
LevelForge's user avatar
-1 votes
2 answers
199 views

Velocity deacceleration working incorrectly

Basicly, I've tried to code velocity into my game, which works sort of. The deaccelaration works sort of, but not correctly. The problem is, that the positive values, decreases just fine and dandy to ...
Kevin Jensen Petersen's user avatar
-2 votes
1 answer
135 views

Objects not Colliding [closed]

I have been having a problem doing 3D collision detection in a game I have been trying to make for several weeks now. What I am trying to do is prevent a PlayerModel object from colliding with ...
Habeeb Adisa's user avatar
1 vote
2 answers
428 views

XNA 4.0 problem Initializing Instanced Classes in for loop

Okay so this is kind of weird, I have some code that creates particle.cs instances ...
steakbbq's user avatar
  • 459
5 votes
4 answers
1k views

Debugging tips? [closed]

I'm new to games programming and I'm working on a C#/XNA project. Something I'm spending a lot of time on is debugging. Obviously as games run in a loop finding the exact iteration that a bad ...
TerryB's user avatar
  • 1,273
5 votes
2 answers
552 views

Particle and Physics problem

This was originally a forum post so I hope you guys don't mind it being 2 questions in one. I am making a game and I got some basic physics implemented. I have 2 problems, 1 with particles being ...
Quincy's user avatar
  • 626