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.
-1
votes
0answers
13 views
Sort an array of Vector2 relative to origin clockwise [on hold]
I found a piece of code that I've tried using to sort an array of Vector2's in a clockwise order, relative to a specified origin point, but it seems sorta random as to whether it works or not, and ...
3
votes
1answer
54 views
Slow update function
I've been fiddling with Unity, trying to make nice walking/running animations. So, i found the Stealth tutorial and I used pretty much the same animator as the AI, only I only use Speed and ...
4
votes
1answer
88 views
Water generating waves and reflection
For the last few days I have been working on wave generation script. As there are a lot of calculations involved I was looking for possible optimizations to improve the performance of the code.
This ...
4
votes
2answers
259 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 ...
4
votes
2answers
130 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 ...
2
votes
1answer
172 views
Simplify Unity 3D C# code
HI have a JSON response from Facebook API, which contains the App Requests of certain Facebook App via FB.API('/me/apprequests') (using Graph API 2.0, Facebook SDK ...
6
votes
2answers
272 views
Enemy patrol script using NavMeshAgent
I'm piecing together an Enemy script to attach to my characters. This is the portion that related the a game objects ability to patrol to given locations. ...
3
votes
2answers
61 views
Triggered movement script for triggered objects
I am trying to more or less perfect a movement script that activates when "triggered" by another object. Below I have the code for both the triggering object as well as the object being triggered.
I ...
3
votes
1answer
93 views
Game stats storage / display
I have a simple game where you try to go as high up with rockets as possible. I currently store 2 statistics about your playthrough:
Current altitude
Highest altitude
These statistics are stored ...
5
votes
1answer
121 views
Random interval generator for a game
I have been working on a few games which all have a need to create "events" randomly over time. The intervals need to get shorter as time goes on if the event is negative or they need to get longer ...
3
votes
1answer
92 views
Speeding up the process of obtaining data
I created this script to obtain data from graphs online, from monavisaxmldata. I were wondering if there was a way to obtain the data faster. The program which uses this data gets presented in a ...
6
votes
2answers
93 views
Rotating a character upside down and vice versa
I have a pretty straightforward task, but I find it hard to figure out how to improve it. The code is pretty straightforward, but rather bad. There are some clarifications / extra details at the ...
1
vote
1answer
85 views
Is there a beter way to check input besides a switch case?
So I am running a Switch case to check if a user has filled in all the necessary fields within a form, and if not I prompt them to do so. I was wondering if there was a better way to do this, or if a ...
10
votes
1answer
519 views
Inspector interface serializer
I've written some code that allows Unity3D's inspector to display fields that conform to an interface. Unity has some quirks about their inspector, so as a preface they are listed here:
If you add a ...
3
votes
2answers
252 views
Fastest way to find and replace inside a large amount of files
Currently I am looping through dependencies of objects, and I am trying to replace GUID (unity object ID's) inside the files.
Right now I am using the following code, any suggestions for improvement ...
5
votes
3answers
110 views
Determining vehicle jump landing quality
I am writing a game where a car drives and makes jumps. When a jump is landed, the player is rewarded if they land all four wheels either at the same time, or near to the same time. If they don't, ...
10
votes
4answers
2k views
Moving character in Unity3D based on accelerometer input
I am building a infinite vertical platformer for mobile platforms using Unity3D. I am using the accelerometer to move the character left and right on the screen.
...
3
votes
1answer
116 views
Pooling System: is it worth improving or not for a simple implementation?
I am using Unity3D and I made a super simply pooling system to reuse a specific object. My only concern is I am not sure if I am doing it the best possible way. If I were doing this in C++ there would ...
6
votes
1answer
408 views
Loop through JSON and create prefab in Unity3D
I am creating an app in Unity3D and it is my first time coding in C#.
I use the following code to parse a JSON file hosted on my server and use the information to render prefabs within my scene:
...
4
votes
2answers
298 views
Dynamic Storing Objects from XML in RPG
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 ...
1
vote
1answer
541 views
Follow Up Inventory Script (RPG) in C#
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 ...
1
vote
2answers
3k 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 ...
3
votes
1answer
135 views
Creating a masonry effect with varying height rectangles
The following is used to create a masonry effect with varying height rectangles. How can I simplify and make this more elegant in Unity?
...