Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [c#]

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

5
votes
0answers
911 views

How do I make volumetric grass?

I've been extremely interested in volumetric technology, especially for grass. Online resources are extremely scarce on this topic. What is the difference from creating a lot of mesh billboards? ...
4
votes
0answers
2k views

(Unity) Proper way to save ScriptableObjects changed during play mode?

I was wondering what the "correct" way to save scriptable objects in Unity that are changed during Play mode. So far I have something that works: ...
3
votes
0answers
51 views

How would one get the pixel value of a texture under the cursor?

I have a requirement to detect which pixel of a texture is under the cursor in the 3D world. I assume that Ray casting is involved however, after that I'm not sure how one would accomplish this. Can ...
3
votes
0answers
143 views

Android game crashes when attempting to start wifi hotspots

I have two methods that will try to start the WiFi hotspot on the android device so that others can connect and play the game.the problem is both method have problems and don't work. the first method: ...
3
votes
0answers
161 views

How to serialize an XNA Rectangle

I'm serializing a data structure to XML using the IntermediateSerializer class. This data structure has an XNA Rectangle in it. ...
3
votes
0answers
66 views

Stop Mesh render on intersect

I am generating camera frustum mesh through code, it is working fine. Now I am searching a solution (shader based or else) to restrict the camera frustum mesh if it intersect with any object. Like you ...
3
votes
0answers
2k views

Procedural Islands Voronoi Pattern

I'm trying to keep this as simple as possible, as I've found out the last few days this is a very difficult topic. I'd like to generate multiple flat islands, formed by a voronoi diagram. I've ...
3
votes
0answers
52 views

Why does interactive cloth not appear in game view in unity5 Pro?

I used interactive cloth fir flags in unity5 Pro version and it appears in scene view but does not appear in game view while playing. What can I do for that please somebody help me out?
3
votes
0answers
3k views

XNA Screen Manager problem with transitions

I'm having issues using the game statemanagement example in the game I am developing. I have no issues with my first three screens transitioning between one another. I have a main menu screen, a ...
2
votes
0answers
21 views

What is causing a SIGSEGV in mono_class_vtable_full in Unity for Android?

I'm a developer of a mobile game, and we have Crashlytics in our game. For the latest release for Android, we are having crash reports with the following stack trace, for a number of players: ...
2
votes
0answers
45 views

Quest UI Display in Unity 2D

I have this quest manager script where I store all my quests for easy duplication. I'm adding a feature that gives the player the option to see his/her current to-do quest. The first thing I ...
2
votes
0answers
76 views

Using C# summary documentation as tooltip in Unity

In unity, I often end up with duplicating the tags for code documentation, and the [tooltip] tags for the Unity Inspector. Is there a way to automatically extract tags into Unity [tooltip]s, or ...
2
votes
0answers
37 views

Sprites being skipped over in simple sprite change script

Each instance of the prefab in question has a copy of this script on it, but they seem to be interfering with each other in some way. I would forego prefabs, except the final game I'm prototyping for ...
2
votes
0answers
169 views

Why doesn't the Camera.pixel(Height/Width) match the Canvas size?

I am making an app that has a custom viewport Rect like so: When I check the sizes of this viewport rectangle in pixels with Camera.pixelHeight; Camera.pixelWidth,...
2
votes
0answers
100 views

Viewport not matching Window size when fullscreen

I am using: GraphicsDevice.Viewport.Bounds to determine the size of the canvas / stage for my window. This works well if I am in Windowed mode, but if I launched ...
2
votes
0answers
92 views

Pre-Hash Input Strings in Unity

So with the new Animator system, Unity has smartly allowed us to pre-hash the strings for looking up variables within the Animator state machine, using the Animator.StringToHash static method. This ...
2
votes
0answers
58 views

How can I move the Player around the space station using the doors as waypoints?

The doors open automatic when the player is getting close to them and then close when the player get some far distance from them. Each door is built from door_right and door_left and I made that each ...
2
votes
0answers
51 views
2
votes
0answers
231 views

Fog of War in Unity

I know that my question will not fall into the type of questions normally asked here (no coding presented). I just need some tips and advise on how to proceed (e.g. pipeline or something). I'm making ...
2
votes
0answers
173 views

Why am I getting errors like these when trying to build my app

I am currently trying to build and publish my app to the universal windows platform halfway through the process of doing so, during the validation process I got stopped with these errors. The 1st one ...
2
votes
0answers
448 views

Unity2D: Proper way to implement ladder climbing with a raycast controller?

I originally posted this on Stack Overflow, but was told I might have more luck here: I've been slowing grinding out programming features for my character controller, and one of the last things to ...
2
votes
0answers
253 views

Simulating Water by changing Y values of Quad Vertices

hopefully this isn't too difficult to answer, but I'm stuck and could at least use some input. I'm working on simulating water for the first time with basic wave functionality. As in I click at a ...
2
votes
0answers
75 views

Unity 2d - rigidbody rotating Z axis if hit something

I have problem with my player. I use rigidbody2D on my player and I had fixed rotation on Z, but now i need use rotation with some of my root animation. Ok, i enabled it, but when my player hit ...
2
votes
0answers
624 views

How can i instantiate empty gameobject to be position to existing already gameobject?

When i click on keyboards for example dfrg i want that if i click on space it will add empty gameobject right after the letter g like a space for example: drg hello So there is a space after the ...
2
votes
0answers
346 views

Making generic type T method as a layer of abstraction for Unty3D's EditorGUI field draw methods

I am making a visual tool for Editor Window on Unity3D, and I am just recently using System.Reflection methods to get class's assembly data, to get information about properties, fields and methods (...
2
votes
0answers
143 views

Design pattern for world objects caching

I'm developing in Unity a voxel-generated terrain and I'm trying to find an extensible design pattern for voxels and more in general, world objects caching. E.g. storing in a 'ChunkCache' class only ...
2
votes
0answers
103 views

Procedurally generated paths with intersections

The Problem I've been attempting to create some procedurally generated paths for a while now, but I've reached a problem when it comes to generating the intersections of the paths. The paths are ...
2
votes
0answers
555 views

Simple 2D Fish Obstacle Avoidance

I am currently working on a simple obstacle avoidance system in unity. I have a player and a school of Ai fish that are traveling in a fixed direction (Down-Right). While swimming, I want the Ai fish ...
2
votes
0answers
208 views

How to make sure two Tiles not overlap each other?

I'm trying to make a Grid who will be easily convertible between 2D and 3D and I'm having a problem with overlapping prefabs in the case of the 3D generation. The thing is, the DataObjects (Tiles) ...
2
votes
0answers
89 views

Monogame resizing GraphicsDeviceControl in WindowsForms?

I'm currently working on a custom Map editor using Windows Forms. I have a class inheriting from GraphicsDeviceControl (called MapDisplay) that I'm using so that I may use spritebatch to draw the ...
2
votes
0answers
305 views

Are there performance benefits to using WaitForSeconds vs checking elapsed time in FixedUpdate in Unity?

I was considering that perhaps just checking the time and then doing some work in the Update function might look cleaner than calculating how long to wait for and calling yield new WaitForSeconds() on ...
2
votes
0answers
1k views
2
votes
0answers
381 views

Rendering hundreds of animated characters in Unity3D

I am currently doing some research in anticipation to the development of a game where there is going to be hundreds of secondary entities which will interact with the player and among themselves (...
2
votes
0answers
98 views

How to disable and enable a randomly generated prefab in an endless runner 3d

Hi all I have been experimenting the endless runner game for some time and needed to optimize it. I read some articles about optimizing my game and it says that once you instantiate the prefabs in the ...
2
votes
0answers
218 views

UNET Performance of (many) Kinematic Rigidbodies

I am building a game in Unity in C# using the UNET networking elements. I am trying to figure out what is the performance cost of kinematic rigidbodies? My understanding is that, when kinematic, ...
2
votes
0answers
354 views

Polygon 2D collision response- How do I find the correct edge a polygon hit?

Hey guys I've been seriously stressed out by this, so please go easy on me. My goal is to reflect a bullet (polygon) off of another polygon, and find the edge the another polygon, A (the bullet), hit....
2
votes
0answers
592 views

How to make the Steam overlay work with WPF?

I have developed a game using C#+WPF and the game is currently on Steam (private branch until release). However Steam's overlay isn't working with WPF. Sometimes it tries to appear in the popups of ...
2
votes
0answers
464 views

Struggling with simple orthographic projection for a 2D setup

I'm trying to build a simple setup for 2D using SharpDX. Basically I want to supply my vertices in classic Cartesian coordinates: X-right, Y-up, starting with (0,0) in bottom-left corner. I've had ...
2
votes
0answers
222 views

Tower Defence stat storing system

I'm trying to find a smart way to store and retrieve stats for a tower defence game, but am currently unsure as to which approach would be best. Description: The stats system should quite basic, ...
2
votes
0answers
119 views

GL.Scissor not working as expected

I have some code for rendering a button in an application and I want to clip the text if it's wider than the button itself. Here a bit of code to describe what I'm doing: ...
2
votes
0answers
354 views

Unity: Create a custom editor for Vector2

I'm starting to dig into Unity's editor customization. What I'm looking for is a way to create custom line (or a point at least) which I could move around in SceneView and set a Vector2 value that way....
2
votes
0answers
1k views

In Unity, how do I make a 3D flight arc preview?

I'm stuck on how to make a preview trajectory for a projectile appear when holding a button. The trajectory should start at a certain position on the scene and end wherever the player points their ...
2
votes
0answers
138 views

Selecting Dictionary item based on custom classes instead of keys

I am attempting to write my own path finding code for a game I'm working on that will implement a form of the A* algorithm. I store my nodes of the path finding system as a class called nodes and add ...
2
votes
0answers
500 views

Is it a good idea to use the RDM socket type for multiplayer games?

I am currently developing a MOBA/RTS style game with an authoritative networking structure. Of course, the server needs to send a big number of packets every second, answering requests from the ...
2
votes
0answers
323 views

Unity - How to Receive “Animator” on AnimationEvent

How to receive "Animator" by parameter on an Animation Event parameter? Its possible?
2
votes
0answers
513 views

Calculate Orbit Path/Ellipse given mass, velocity, and distance (2body)

Calculate and draw the path of an orbit in a 2 body problem given the mass, current velocity, and distance of both bodies? We're working in Unity and will be using the default rigidbody.mass to start ...
2
votes
0answers
535 views

Recursive backtracking sometimes missing a tile?

I have a basic recursive backtracking alghorithm for a maze. It pretty much works but ocasionally leaves some tiles in the corners untouched. This is the recursive function: ...
2
votes
0answers
526 views

How do I Animate a character in Unity3D (Animator)?

first of all, I am new to Programming and Unity, but I want to create a simple game with Unity3D. I am using the StandardAssets (character) where all animations are included, but I dont get how to ...
2
votes
0answers
255 views

Improving effect performance in XNA

I'm making a 2D, top-down platformer, in which four or five layers are rendered each time the game draws. Everything is fairly performant except for the bottom layer, which is the game map. This is ...
2
votes
0answers
53 views

Xna 4 Model Rotation with inertia not working as expected with variable updates

I am trying to rotate a model with inertia damping with the keyboard. The code works great with a fixed time step but it doesn't behave the same with a variable update frequency. Update method: <...