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.
227 questions
0
votes
0
answers
97
views
Negamax Implementation for Unity Hnefatafl Game
I've been banging my head against the AI for a Hnefatafl game I'm making (pronounced NEF-a-taf-full, otherwise known as Tablut) for quite a while now. It's caused me no end of frustration, though I ...
7
votes
1
answer
129
views
Player controlled dungeon creation system
I'm making a game with a system inspired by the PSP Game Dungeon Dungeon maker 2 the hidden war: Visual Reference. I have everything set up but I feel there are ways to make the code more simple and ...
5
votes
1
answer
120
views
Service Locator C#
I made this service locator to be used on my game projects, but it uses pure c#. Basically, new services needs to inherit from the common IService interface to be registered. I also added events to ...
4
votes
2
answers
265
views
C# items that don't follow rest of interface
I'm working on a game with unity, and I've created a state manager for the in-game state of certain organisms. Each state implements a ISimpleStateManager interface,...
2
votes
2
answers
78
views
LinearUpscale2DArrayInPlace in Unity Jobs
Well,
I have this function which is called in the Unity Job system, I'm profiling it:
The code:
...
2
votes
1
answer
244
views
How to optimize the player movement code like in Tomb Of The Musk game?
I've written some code that performs movement similar to the Tomb Of The Musk game. The idea is that the objet should move in a certain direction until it encounters an obstacle. After that, the ...
1
vote
2
answers
127
views
Optimize and Simplify Raycasting Code in Unity for Store Clerk Interaction?
I plan to use a raycast for interacting with all things in my games but Im afraid itll be too laggy how can I shorten this code up?
...
8
votes
8
answers
3k
views
Can I lessen the use of boolean flag variables in this snippet?
Below snippet is part of a game application's logic and the Update function is called every frame (about 60 times a second).
...
0
votes
1
answer
140
views
Strategy Pattern Inside State Pattern
I'm making a fps game where I created a hierarchical state machine; the problem is the two types of movement (standing movement and crouching movement). They are very similar; the only difference is ...
4
votes
1
answer
160
views
C# wrapper that binds to Rust FFI, for the purpose of running CavalierContours functions in Unity
I have attempted to write c# bindings for a Rust library. I have never worked with unmanned code / languages before. Superficially this code does work with no apparent bugs or memory leaks.
I want to ...
2
votes
1
answer
400
views
Drag-and-drop handler for card game
I'm currently writing a card-game in Unity and the below code handles the player's ability to drag/drop cards onto various sections of the game board. Right now, I have this nagging feeling that as it ...
1
vote
1
answer
55
views
Moveable Points - Update variable without Re-referencing variable? Event Subscriptions? (C#, Unity)
So I have this helper script that I use to move points around manually while debugging:
...
2
votes
1
answer
152
views
Weapon shoot system FPS Game
Hello I'm currently developing a FPS game for my portfolio and I made a weapon shoot system, and I would like to receive feedback about my code to make more cleaner and efficient. Thanks.
...
0
votes
1
answer
56
views
2
votes
1
answer
251
views
Generic Interpolation for many types in C#
I made a generic interpolator for Unity objects, but the way it functions makes me question if there's a better way to approach this problem.
I want the logic inside of the ...