C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.

learn more… | top users | synonyms

8
votes
0answers
123 views

Dual Contouring - Finding the feature point, normals off

I am following this tutorial to implement Dual Contouring http://www.sandboxie.com/misc/isosurf/isosurfaces.html My data source is a grid 16x16x16; I traverse this grid bottom to top, left to right, ...
4
votes
0answers
87 views

How to await async operations / coroutines?

I'm looking for a generic / reusable way to wait for coroutines and asynchronous operations to finish in Unity 5, similiar to C#5's await keyword. The simplest way I can think of is something like ...
4
votes
0answers
208 views

smoothly recenter view over time

I'm currently using the Google Cardboard SDK for Unity to build a fighter pilot simulator. What I'm currently trying to do is recenter the view(CardboardHead) smoothly over time when the user looks ...
3
votes
0answers
24 views

Automatic audio segmentation and find the most energetic segments

What algorithm can be used for audio segmentation? I want to divide song to segments and find the most energetic segments (begin and end in seconds). It is needed for the rhythm-game. Examples: ...
3
votes
0answers
56 views

(Monogame) Camera does not travel the way it is rotated

I've implemented camera control with mouse and keyboard. My problem is that camera goes crazy when I'm using mouse and camera does not travel the way it is rotated. Could you explain me why and how to ...
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
126 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
130 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
29 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: GL.Enable(EnableCap....
2
votes
0answers
135 views

Building an Octree for terrain generation

I've previously implemented marching cubes/tetrahedra to render an IsoSurface. It worked (YouTube), but the performance was dire as I never got around to implementing LoD (or even removing distant ...
2
votes
0answers
88 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
205 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
124 views

Unity - How to Receive “Animator” on AnimationEvent

How to receive "Animator" by parameter on an Animation Event parameter? Its possible?
2
votes
0answers
38 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?
2
votes
0answers
234 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? ...
2
votes
0answers
236 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
197 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
47 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: ...
2
votes
0answers
565 views

XNA 4.0 Pixel Shader 3.0 Exact Texture Lookup/Sample Issue

I am stuck on trying to solve this problem. I originally had some shaders written that worked for XNA 3.1, but after converting to XNA 4.0 they would no longer compile due to instruction counts, flow ...
2
votes
0answers
298 views

Chunk Texture3D GPU generated vertices

I read GPU Gems 3 from NVidia about procedural terrain. It's quite interesting but not applicable for me because I only read the online version without the shipped DVD so I'm not able to download the ...
2
votes
0answers
442 views

Call Unity3D coroutines from a scripting language

I created a simple scripting language to use on a Unity3D game. My parser generates an AST with nodes for every type of operation, and to run the script all I need to do is call Execute() on the root ...
2
votes
0answers
231 views

Difference between multiple AudioUnits and one AudioGraph with a MultiChannelMixer

I'm porting my game to iOS using MonoTouch, and I'm having some trouble getting sound output to work. SystemSound/AVAudioPlayer is way too simple for my needs (I need looping and multiple simultaneous ...
1
vote
0answers
26 views

Unable to control trigger events for car animation collsion control

I have different car animation running on the road which have imported from max. I want to make such an intelligent System that if car start to trigger from another car it become stop. So far I have ...
1
vote
0answers
32 views

Export UnityProject inside Android Studio's existing project

I am new to the Unity3D, but I have made a small Unity project with a humanoid gameobject. I can move this humanoid with the demo data but I want to move it with the quaternion data which I am already ...
1
vote
0answers
52 views

Unity game randomly closes when phone is streaming the screen?

My Unity android game (frequently) randomly closes on some phones when it's streaming with the YouTube Gaming App for example. I have Unity version 5.3.5f1. I have to say that this phenomenon did not ...
1
vote
0answers
21 views

Weapon Sway Script messes up weapon rotation

So I'm in the process of learning Unity 5 and scripting in it. One thing I wanted to give a try was to make a simple weapon sway script like you see in games such as battlefield or csgo. After a bit ...
1
vote
0answers
27 views

Unity - SerializedObject.ApplyModifiedProperties() using relavant property setting method

The problem I have is this. I have an editor script, at the end of OnInspectorGUI() I want to apply all the changes with the serialized object. The simplest way to show my problem is thus: [...
1
vote
0answers
26 views

Unity play sound from Audio Source

I'm using the following code to play a sound in Unity 5: AudioSource aud = GetComponent("doorSound") as AudioSource; aud.PlayOneShot(aud.clip, 1.0f); But no sound is playing at all. What am I doing ...
1
vote
0answers
125 views

In game replay system doesn't work correctly when animations are used on a character

I have created an in game replay system that essentially just stores each object's position and rotation at each FixedUpdate(). Once an even is triggered, the replay is then played back using ...
1
vote
0answers
54 views

How should I structure a Shared Library for different platforms for my MonoGame project?

I am quite new to the MonoGame/XNA framework and i have some structuring questions right now. One of the reasons I use MonoGame is because there is still that feeling to create a game from scratch ...
1
vote
0answers
34 views

How to draw things on top of objects drawn in OnRenderObject()?

I am using Unity, here is the method in question. So I know this method draws objects after the camera is done rendering the scene. I have not come across a way in Unity to draw these objects in a ...
1
vote
0answers
83 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 ...
1
vote
0answers
62 views

Connecting to external computer with lidgren

I'm new to networking and thought i'd muck around a bit with lidgren before i start implementing it in my games, so i made a little client/server chat program that works fine on localhost and lan. I ...
1
vote
0answers
47 views

How to draw SharpDX 2D Bitmap Outline

i want drawing bitmap outline Now Drawing Device.DrawBitmap(mBitmap, GetBound(), Opacity, d2.BitmapInterpolationMode.Linear); // mBitmap as SharpDX.Direct2D1.Bitmap // GetBound() as Bitmap Bound
1
vote
0answers
65 views

How can I change the list of enum options displayed in the inspector?

I have an array of enums: using UnityEngine; public class EnumsInInspector : MonoBehaviour { [SerializeField] public EnumType[] myEnums = new EnumType[3]; public enum EnumType { ...
1
vote
0answers
96 views

Turning On/Off Vsync no longer working when rendering to an offscreen buffer

I have this reaallly strange issue that as soon as I render to an offscreen framebuffer I am no longer able to toggle VSync while my application is running. I am using OpenTK as the opengl wrapper, ...
1
vote
0answers
33 views

Translate D3DXMatrixLookAtLH to Unity compatible code

I am currently trying to port a really old Game (I have the source of it) to Unity as a fun project. And I'm currently stuck with the object rotation techniques in Unity compared to the ones used in ...
1
vote
0answers
43 views

Map generation, issues with midpoint displacement algorithm

I'm trying to generate an endless 2d terrain. So the terrain isn't random per say as the random function I'm using is a hash based on an X,Y coordinate. static public float rand (System.UInt32 x, ...
1
vote
0answers
43 views

Farseer Engine Texture To Polygon Center of mass bug

I am new to Farseer Engine used with MonoGame so I decided to do some test with the API to see the results and learn. If I understand, in Farseer the Position property of a Body object is located at ...
1
vote
0answers
93 views

Unexpected behaviour after adding animator and Unity editor crash

I have realy strange problem which accured after adding animator(I suppose) to prefab Object. Situations looks like follow: I had object which have only sprite renderer, collider2D and script (...
1
vote
0answers
191 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 ...
1
vote
0answers
57 views

SignalR Monogame Lag

I'm creating a C# multiplayer game in Monogame using SignalR to update the enemy players positions. This is my proxy.invoke: proxy.Invoke("UpdateEnemy", LocalShip.Position, LocalShip....
1
vote
0answers
41 views

Background replacement with 3D moving objects using Intel RealSense SDK

I have done background replacement with static image and video using RealSense and c#, but now the requirement is to replace the background with the 3D moving object in still background. Is it ...
1
vote
0answers
226 views

How to use OpenTK (OpenGL) with MonoGame?

So I've been making a snake game using MonoGame (DirectX Only). I added movement, controls, feeding and growing in length. I wanted to add smooth animations to the game because the snake is just made ...
1
vote
0answers
185 views

Dual Contouring - what is it and how to use it?

I'm having trouble understanding Dual Contouring yet and I need some explanations from someone who has first hand experience. I searched all I could before writing this question. I've already read: ...
1
vote
0answers
291 views

Standard Assets Cross platform joystick sensitivity

I am using the standard asset joystick that comes with Unity 5, the sensitivity changes depending on the device used, for example on an Samsung S3 it is more sensitive than on a Nexus 7 2013, how can ...
1
vote
0answers
75 views

Scale texture at runtime in unity

I need to scale the texture in unity3d.In unity we are able to adjust the scale using the option in the toolbar How will I scale the texture at runtime using the mouse pointer. the texture should ...
1
vote
0answers
80 views

Screenshot preview freezes a game for a few seconds

I have a screenshot preview at the end of the level, but when I show it my game freezes for a bit(low fps for a few seconds). This is code I use to load screenshot and crop it(for a little preview ...
1
vote
0answers
84 views

How should I store battle effects?

I have battle effects that can be anywhere from 50-150 frames (running at 60fps). I need to be able to draw each frame of the battle effect as an additive layer onto my game. A frame could look ...
1
vote
0answers
55 views

How I can get the time, where I am in a map for osu?

How I can get the time, where I am in a map for osu??? I need an osu!api solution, and I want to get this value: 0:05.12 or something like this.