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

0
votes
0answers
6 views

BoneOrientation in Kinect v2

How do I get bone orientation in Kinect v2? Kinect 1.8 used to have a BoneOrientation class, but there is no such class in v2 (only joint orientations).
0
votes
1answer
31 views

How can I verify if there is no object between 2 others?

I have 2 characters in my 2D game, I would like that if both of them are on the same Y axis, and there is no collider/object between them, for an animation to happen. I can't figure out how to check ...
0
votes
0answers
17 views

Unity 5 bug with android splash screen

So I am using unity professional and I changed the splash screen. When my game starts there is a short stutter for 2-3 frames. I only captured 1 because I can't couldn't capture it. The image on the ...
0
votes
0answers
17 views

Press back again to close in unity?

I have already created a java code for press back again to exit in eclipse and its working perfect .....but I do not know how to integrate it with unity....between I have jar file and put inside of ...
0
votes
3answers
44 views

Getcomponent(), GameObject, and Component issues

I have been trying for over 2 hours now to get over these problems : I have 2 GameObjects in my hierarchy, but I do not have them anywhere in any script. I would very much like to add those 2 ...
0
votes
1answer
35 views

Instantiating a prefab as a child to another game object (spawn point) - Unity 3D - C#

I am currently working on a 3d game in unity in C#. I've been following a series of tutorials on youtube (burgzerg arcade) for quite a while now, and i've came across the following error. This error ...
1
vote
2answers
50 views

Is it possible to control what script is active on what sprite/object in Unity?

I have 2 objects, and I have a script which makes the player change their characteristics. I applied the script to both, and as you'd expect, pressing X button does the color, size, translation change ...
0
votes
4answers
86 views

Class design and data structures for a Tower Defense

I was trying to come up with a structure for a simple TD game that has following elements Tower Each Tower has a set of properties like range, damage, health etc There could be different types of ...
0
votes
1answer
28 views

Wrong distance in Depth-buffer

I am currently trying to get the Depth Buffer as a texture to use it for edge detection algorithms. Since XNA4 does not allow direct access to the Depth Buffer as texture i have to render it into a ...
1
vote
1answer
108 views

Unity 5 2D drawing sprites programmatically

How can I draw sprites in Unity 5 programmatically ? I am looking for something similar to spriteBatch.Draw() in XNA. The results I get when I search about it are either outdated ...
0
votes
2answers
65 views

Vector3.Angle() Never Reaching 0

I'm having trouble understanding why with this script, Vector3.Angle() sometimes will never reach 0. This question comes from me trying to make a "turret" that rotates to face a target position. It ...
0
votes
0answers
57 views

Physics2D.OverlapCircleAll seems to be bigger than my radius

Im trying to make a "Scorched earth"-like game using unity. I managed to fire my bullet and make it explode on contact. What I am trying to do is do some damage to the tanks even if the bullet didn't ...
1
vote
1answer
41 views

Relation between “Run in background” setting and OnApplicationPause method

I'm working on a game for mobile platforms (Android at the moment, in the future it should be available for iOS and WinPhone) and I want to trigger a certain method when the game is un-paused. For ...
0
votes
0answers
29 views

How to play a video and run content at the same time

Alright, so I have a video loaded, and other game content. Earlier this morning, when I was just learning how to actually play a video, I magically happened to get the video running in the ...
0
votes
2answers
69 views

2D indicator for Rotation in 3D space

This is the view from my spaceship. It can move around in 3d space and turn up, down, left and right. The planet Earth on the top right is selected. Now I want to create the red arrow to always ...
1
vote
1answer
209 views

How to rotate an object to face another in Unity?

I'm having an issue where I can't seem to rotate my bullet appropriately whenever I spawn one. I currently have a capsule prefab I am testing with. I spawn it with the following code. ...
0
votes
1answer
50 views

Can someone explain to me the difference between 2 XNA methods?

I was recently trying to make a boucing ball off the environment walls. I apparently had everything correct, except for one thing, that I corrected stupidly, which made my code work, but I don't ...
0
votes
1answer
26 views

Rotation and timer at the same time

I have a project where I flip a card after 5 seconds, then I want to start a countdown timer of x seconds. After x seconds the card flips again. I found a good example for the timer here, but that ...
1
vote
2answers
134 views

Unity: DontDestroyOnLoad

I'm viewing tutorial of Unity. In this tutorial, I see this piece of code: public class GameControl : MonoBehaviour { public static GameControl control; public void Awake() { if ...
0
votes
1answer
39 views

Trying to implement physics to my player. Can't get it to work

I'm currently stuck on where to add physics to my player. Currently it's set so the player spawns in the middle to the left of the screen and can move around, but I want to make it so the user has to ...
0
votes
0answers
46 views

How to get a position from a radial distance and angles?

I have a radius and the 2 angles for northSouth and eastWest rotations in degrees. I need a Spherical position or a cartesian position (I have code translate one to the other) Where a position is ...
0
votes
1answer
21 views

Unity3d - c# - changing FPSInputController controls through script

For a game I am making I would like the user to be able to change the controls (in game NOT through the clunky launch window (wich i disabled)) I have the system working but don't know how to change ...
2
votes
1answer
40 views

Replacing a sprite for another on runtime (Unity3D)

I need to replace the sprite of a face down card for another sprite (of a face up card). This is the C# script attached to the face down card: using UnityEngine; using System.Collections; public ...
0
votes
0answers
24 views

Can Raknet 3.x be used with C#? [closed]

I have a project which needs to use Raknet version 3.x. Is it possible to use Raknet 3.x with C#?
0
votes
0answers
48 views

Isometric staggered multi tile buildings

I'm writing a isometric staggered rpg engine and i am at loss to how to make the buildings placement diamond show up. What I mean is i have tile2screen and screen2tile functions and it works ok. I ...
-2
votes
0answers
50 views

Looking to learn a new language and create a game, what language should I learn? [closed]

Currently I have some basic knowledge in c# and I know Javascript/HTML/CSS/PHP on a high level. I have a idea for a game which I want to create and along the way learn a Object Orientated language. ...
1
vote
2answers
112 views

how to 'Scale up' my procedurally generated island/continent without losing its uniqueness?

Currently I am trying to make a procedural terrain generator. When I first started creating my terrain generator I decided to use a radial mask to generate my islands/continents like so: But as ...
0
votes
0answers
20 views

save and view snapshot image from android device

I'm having a problem with saving image into an android device this is what i did My java class : package com.test.app; import com.unity3d.player.UnityPlayerActivity; import android.os.Bundle; ...
1
vote
1answer
40 views

XNA Monogame - Move .dll and .xml root folder

I was just wondering if it's possible to move the dll and xml files into a subfolder, like in this picture: Thanks !
0
votes
1answer
48 views

How to deal with events in a game with multiple players, in Unity?

As I'm developing our game I have asked myself a couple times "When we have more than 1 player, how will I ensure events from player A do not crossover to player B?" As an example, lets say player A ...
-1
votes
0answers
82 views

Is XNA still relevant? [closed]

I am currently devlopping a game with XNA. But the community seems to not be active anymore. That's why I am asking if I should still go on... What's the advantage of using Unity3D ? Will I be able to ...
1
vote
1answer
52 views

Unity2D: Automatic scaling of camera and sprites

I'm working on a point-and-click adventure game using Unity2D for mobile devices and possible PCs and I'm trying to wrap my head around supporting devices with different screen sizes and aspect ...
0
votes
1answer
22 views

Changing the texture filtering methodology within the same SpriteBatch Begin/End pair

How would I go about using changing the texture filtering method being used within the same SpriteBatch Begin/End pairing? I have this code so far. spriteBatch.Begin(SpriteSortMode.Deferred, ...
2
votes
1answer
112 views

Why are Texture2d arrays so expensive? [closed]

I'm building a 2d engine in C# and I have several static sprites that have multiple color variations. Ok, easy enough, I create the Texture2D images at start time, then stuff them into an array, and ...
0
votes
2answers
101 views

How to stop objects pushing each other away on collision?

I'm creating something along the lines of Super Smash Brothers. There's a problem with the collision between the two players and projectiles. We have rigid body on the characters and projectiles and ...
0
votes
1answer
42 views

MonoGame InstancePlayLimitException on Windows w/ OpenGL

Why am I getting the InstancePlayLimitException when playing several SoundEffects per second despite there being no limit unless programming for mobile? It occurs after only a few seconds of repeated ...
0
votes
2answers
70 views

How to add a logo to a captured image?

I have a plane which contain a WebCamTexture and a button to capture the image script to capture the image void CaptureAndSave () { Debug.Log (Camera_panel_script.webCameraTexture); ...
1
vote
1answer
50 views

Rotate on key down, revert rotate on key up?

How would I rotate an object a certain number of degrees when the left arrow is pressed and then rotate it back to its start when the left arrow is released?
2
votes
1answer
50 views

Good way to support multiple types of triangles? (C# XNA)

[this question is somewhat long. here's my question in a nutshell] I want to use multiple types of Vertex data types for my triangle, interchangeably. So if I have a generic type T private void ...
1
vote
1answer
37 views

Pick which directional light shades which object

Suppose you have two directional lights pointing at one sphere from different angles. You would expect the sphere to cast two shadows, but it turns out that this isn't the default behavior. The first ...
0
votes
0answers
27 views

Raycasting from vertices is not working

I have two perpendicular planes in xz and yz like this I want to find the projection of the vertices of plane 2 on plane 1 using raycasting.The rays are hitting the plane but the log is showing ...
1
vote
0answers
57 views

From XML to class method

I'm trying to implement a dialogue system for a game in Unity(c#). I'm going to use xml cause I want the dialogues to be editable/added from outside. I have a practical problem. Let's say I got this ...
0
votes
1answer
52 views

How to find the closest point on a plane

So I have this terrain with a perpendicular plane setup, now I want to move the vertices of the plane to their closest resp. vertices on the terrain. I made a drawing to illustrate my thoughts. ...
0
votes
1answer
127 views

Vector2 to 3D world coordinates

I think I am almost there, but not quite. I am trying to transform a 2D point, (in the following example (100,100)) into 3D world coordinates, in order to draw my 3D Model named TestModel in ...
0
votes
0answers
34 views

How would I change an object's fixed angle upon collision with another object?

I'm trying to get an object to change its fixed angle once it gets hit with an object via collision, unless there's a better way. This is the code that I was using for a slingshot weapon so I figured ...
1
vote
1answer
78 views

How can I test if one point can “see” another point. (XNA)

I want to test if my enemy can see the player, however I want this to be pixel-perfect. I already have all of the solid objects drawing into a separate render state. It should be noted that every ...
1
vote
1answer
43 views

Event handling on own UI implementation in XNA

I´m creating a game in XNA with my own UI and its controls/components. Currently I have some problems with the event handling. Let me tell me the way I do it right now. Every object is handles as a ...
0
votes
2answers
68 views

How to make instantiated objects not on top of each other?

I randomly instantiate game objects, to create a dynamic "sky map". But some planets appear on top of another ones. I'm trying to solve this problem with Collision detection and Colliders, but it ...
-1
votes
2answers
78 views

Rotating an object continously with OnMouseDown

I have a script that works but it does not do what I want it to do. My script makes an object rotate on when another is clicked. However, I want the object to continuously rotate until I click on the ...
0
votes
0answers
15 views

Rotating an object continously in UNITY with onclick [duplicate]

I have a script that works but it does not do what I want it to do. My script makes an object rotate on when another is clicked. However, I want the object to continuously rotate until I click on the ...