Questions tagged [unity3d]

Unity, also referred to as Unity3D, is a cross-platform game engine with a built-in IDE developed by Unity Technologies. It is a commercial development platform for creating games, interactive 3D applications, training simulations, and medical and architectural visualizations.

Filter by
Sorted by
Tagged with
28
votes
4answers
4k views

Snake Game in C#

Recently, I have been trying to learn SOLID principles. I learn the best through criticism. I made this snake game in Unity with C#, where I put my current understanding of SOLID principles to test. ...
15
votes
3answers
1k views

Simulating gravitational attraction between bodies

I'm currently working on a simple simulator in Unity3D that involves planets orbiting each other. I wrote the following C# script to do that. It uses the classic gravitational formula, $$F=G\frac{...
6
votes
2answers
196 views

Do you want to be a super (voxel) hero?

I have implemented an upgrades system in my Unity3d game, and I am pretty sure that I am not doing things in an optimal way. Any advice regarding best practices would be much appreciated. The idea is ...
5
votes
1answer
3k views

A* Algorithm in C# for pathfinding 2D tile grid

I am very new programming and am trying to develop a small tycoon game as a hobby project in Unity. This algorithm executes beautifully but if 100+ agents are getting new paths simultaneously there is ...
5
votes
2answers
1k views

Calling a method to draw parallel lines

This question is a followup to the last one. I followed RobH's advice and his edge case bug found in my code with this solution: ...
4
votes
1answer
2k views

Number Wizard game

This is a number guesser that guesses a random number between the values that you set. The user has to use the up or down arrow keys to say if the number that they thought of between the number ...
4
votes
1answer
711 views

Object pooling for a top down shooting game

I have an Asteroids clone I'm working on and I want to see if my object pooling is written correctly. The code works I just want to know if there is anything else I need to change to make it more ...
4
votes
2answers
865 views

Voxel Islands - Dynamic mesh generation

While I can often understand the performance reasons behind using fixed-size arrays to store vertex, triangle and UV data, I've often found it annoying because it makes dynamically generating meshes ...
4
votes
2answers
279 views

Importing different type of files into Lists

I am using a recursive directory scan to find all objects inside a Unity3D project. After that, I wish to move all these files to a sorted List. Is there a cleaner ...
4
votes
1answer
252 views

Sequentially displaying a list of game objects

A chat background is created and text[0] is displayed with a button created under it. The created button iterates thru text[] ...
4
votes
2answers
703 views

Checking for duplicate materials

This is a follow up question of Importing different type of files into Lists. Where the original lists are acquired. In this script I am processing the obtained lists, and comparing them with each ...
3
votes
1answer
452 views

Object Pooling in Unity

I've made 2 object pooling classes - MonoObjectPooler : MonoBehaviour - can hold a single bucket of pooled objects of 1 type. ...
2
votes
1answer
379 views

Unity3D like component system

I am currently working on my own little game engine and thought about implementing a simplified version of Unitys component system where you can attach objects of derived ...
2
votes
1answer
321 views

Tic Tac Toe (decoupling patterns and component based design)

I'm learning Unity with C# programming and am trying to learn game design. I know the that the best way to learn games programming is to recreate some existing games, and this is my code to create Tic ...
1
vote
1answer
127 views

Choosing/creating/setting an NPC dialogue - follow-up

Initial post: Sequentially displaying a list of game objects This file creates a dialogue box and sets the chat history box too inactive. It finds which NPC dialogue to display, creates the list and ...
0
votes
2answers
10k views

Inventory Script (RPG) in C# [closed]

I would prefer if more experienced users could give pointers on how I can optimize and think better when writing code. If you are unfamiliar with unity3d, ignore the use of UnityEngine, the heritage ...