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

1
vote
1answer
25 views

Waitforseconds is skipping over

I have a function for a timer using waitforseconds but instead of waiting for how long I want to, it just skips it. A ui text should become "foo" then 5 seconds later become "bar" but it turns to ...
0
votes
0answers
27 views

My bullet changes the velocity depending on where I click

I want to build a little 2D-Sidescrolling shooter and I'm now at the shooting script. I already figured out how to shoot a bullet towards my mouse pointer. I got something like this : Vector3 ...
-2
votes
0answers
12 views

Android unity Build error [on hold]

i add the admob in my unity project i got this error Error building Player: Win32Exception: ApplicationName='javac.exe', CommandLine='-bootclasspath C:/Android/sdk/platforms/android-21\android.jar" ...
0
votes
0answers
22 views

How should I organize multiple materials?

I'm making a tile-based game, in which many tiles will be of the same type, and so I want to avoid having the same texture for all of them. I'm thinking of having multiple textures for those widely ...
0
votes
1answer
29 views

Sprites not showing (C# - XNA 4.0)

I'm following a tutorial from XNA GPA, but in my project, none of the sprites are loading. I've followed all of the instructions exactly, and the code works as expected when I copy it from my project ...
0
votes
0answers
21 views

MenuItems in Wpf

Creating a GUI editor for a game using wpf and I have a menuItem that I am having problems with. I use MenuItem.Items.Add to add a menuitem to another menuitem. I figured to access it again I could ...
0
votes
1answer
21 views

Problem disposing content from a screen's content manager

I have a problem with my game. I am using multiple classes for different screens, for exemple: Main Menu is one screen, When playing is another, and so on... I decided to use multiple ...
1
vote
2answers
47 views

Preventing a Combination of Rigidbody Jump Force & Bounce Magnitude in Unity3D

I'm building a fairly simple marble racing game in Unity3D. The ball is a 3D physics object that moves only on the X and Y axes. It has the ability to roll left and right, and to jump. Pretty basic ...
0
votes
0answers
24 views

XNA 2D Tile Baseed Map Collision Messing Up On Inside Corners

I'm creating a 2D Over the head game and the collision system works fine for straight walls and outside corners although not for inside corners. The walls are done by each solid tile having a ...
0
votes
3answers
38 views

Calling and functions/methods from different Classes in Unity

I am learning some of the basics with Unity and am running into calling/sending code to a different script. For example, the code below is a basic menu of options. I have a different Scene set up in ...
-1
votes
1answer
36 views

Get current position of instantiated prefab

I wrote two little scripts to manage platform spawning. 1st - is attached to the Spawner gameObject. It's uset to spawn new platform. 2nd - is something like Platform Manager which not extend ...
0
votes
1answer
38 views

Random movement of game Object staying in a circle

I want to write a script which makes several objects move in a random direction but within a range around another game object. If the parent object moves then that range should also be changed ...
0
votes
2answers
37 views

Shooting at mouse in unity

I'm using unity and trying to get my bullet to shoot at a target. I am clicking the mouse and I'm wanting to fire my bullet in that direction. I have gotten the coordinates of the mouse click and ...
0
votes
0answers
13 views

How do I extract the UV data from an FBX file?

I've written a FBX file loader for my 3D graphics application. The FBX file was created with Blender and saved in ASCII format. I'm having trouble converting the UV data. In the file is the following: ...
0
votes
0answers
46 views

Unity3D - Unable to attach script to GameObject prefab at runtime

I've got a script that manages a scene browser within my application where I'm hoping to generate a new button instance for each scene found. I've put together a button that I've made into a prefab ...
-1
votes
2answers
48 views

How to enable and disable scripts on a Game Object?

This worked briefly yesterday, I believe I did something to mess this up. All my inputs that I put in are correct; therefor, it must be the code. I want to switch players. While the red cube's script ...
0
votes
0answers
35 views

Check if body is on the ground

In my game I have an quite irregular terrain at the bottom and a round ball which can be controlled by the keyboard. Is there any way to check, if the ball is currently on the terrain? This is very ...
0
votes
0answers
39 views

Non linear scaling to show a sol system

In a sol system 2d simulation I have some problems in showing the entire system (ie: eaven planets far away than saturn ) letting distinguibles the nearest planet orbits. Actualy a use a simple ...
0
votes
1answer
17 views

Kinematic equations script fail

I added the kinematic equations to my code and now none of it works. I get the error rigidbody.torque assign attempt for 'Enemy' is not valid. Input torque is { 0.000000, NaN, 0.000000 }. ...
-2
votes
1answer
23 views

showing Load 'name' (-1) couldn't be loaded because it has not been added to the built settings even after adding it

I have created 3 scenes (StartMenu, Game, Win) and added all of them to built setting with proper arrangement. StartMenu Scene has a button start which should take game to second Game Scene when ...
1
vote
0answers
8 views

Amazon IAP V1 not working on unity

I've been following the tutorial for amazon iap v1 (because it seems a lot easier than amazon iap v2) but when I built the android app and went onto the shop screen the app just force closed. Here's ...
1
vote
1answer
75 views

How to get rid of jerky movement in scrolling? C# / XNA

I'm having a bit of trouble with my code meant to create a scrolling background of random-ish ones and zeros. When moving to the right (or left), it scrolls smoothly for a few seconds, stops/jerks, ...
0
votes
1answer
44 views

Change sprite to animation in unity 5 2d (c#)

I want to do the same as this older post with one change: Change the sprite of a Object in Unity I want to use a .anim animation (created with unity) after the space key is pressed instead of ...
0
votes
0answers
20 views

How can a text asset be added to an asset bundle using C#?

As far as I can tell assets can only be assigned an asset bundle through the editor. Is there anyway to assign an asset an particular asset bundle in C#? Specifically a text assets? I'm trying to ...
0
votes
0answers
16 views

Problem with cameracliping unity

Hello GameDev Community, i've got a small problem with figuring out a way to do cameracliping in the unityengine with raycasting i got two main problems the first being that my camera flicks ...
0
votes
0answers
31 views

Facebook integration issues

I have a "weird" problem with integrating Facebook in my game. The problem is that i can not see the scores of all my fb friends. (I have a high score panel where i visualize my fb friends best ...
0
votes
0answers
9 views

Creating a skinned mesh with SlimDX for DIrect3D9

I'm trying to convert a mesh into a 'Blended Mesh' using the ID3DXSkinInfo interface(wrapped by SlimDX). I am expecting that the resulting mesh contain blend weights but they do not. Here is code to ...
1
vote
0answers
11 views

Reading messages from a certain client in Lidgren

I'm setting up a game with Lidgren, and I was wondering if there was a way to read a message from a certain client instead of just from the server as a whole, such as- //Why doesn't this exist? ...
2
votes
3answers
149 views

How do I make an endless road in Unity?

Basically I created 2 quads side by side and I added a road texture. I used transform.translate so that the road moves, but I am trying to make the road endless by making the 2 quads reposition ...
0
votes
0answers
75 views

Why do 100 rect contain 400 tris?

I am making a game targeted towards mobile, so I am experimenting around to know how I can boost performance. Now I have a rectangle with a road texture on it. This I made in Blender. And as expected ...
0
votes
1answer
11 views

Arrow key control on winforms RichTextBox

I am making a faux console using winforms for the game I am working on. Right now I am moving a '0' across the screen using the arrow keys. In order to provide fine grain formatting on the text, I ...
0
votes
2answers
31 views

How can I easily assign an array in the inspector?

If you make a public array class member in Unity, you can individually assign objects to the array in the inspector menu. It looks like this: However, this is cumbersome if you you want to assign ...
0
votes
0answers
13 views

Update part of dynamic Vertex Buffer. SharpDX

I'm creating application to draw simple 2D charts in a fast way. Updating my VertexBuffer is implemented as below: Device.ImmediateContext.MapSubresource(_signalVertexBuffer, ...
0
votes
1answer
35 views

Draw transparency

I want to draw a terrain in a Texture2D at runtime in order to make collisions work with Farseer Physics later on. What I need is to make some parts of my original texture, which is just a colored ...
3
votes
2answers
60 views

Efficient parsing of text file to map

I am creating a roguelike which will use an ASCII based tile set. There is a text file that represents the map (ie. walls, floor, items). I believe the next steps are to read this file in and use a 2D ...
0
votes
0answers
24 views

Cutting shapes out of the terrain

I am trying to use Farseer Physics to cut out shapes from my terrain: // contains all vertices of terrain List<Vertices> terrainVertices = new List<Vertices>(); // makes a crate into ...
10
votes
4answers
1k views

How do you allow networking code to be written in the later stages of the development?

I'm currently in the early progress of writing a game which I eventually will want to improve in most aspects. How can I skip out on writing network code yet leaving it fairly easily implemented, that ...
2
votes
0answers
29 views

Lidgren not starting server properly

I have a server set up for my game with Lidgren, and it works well when I have it set up on one machine, but if I try to run the server on another machine, I am unable to connect from other machines. ...
0
votes
1answer
18 views

2D Lock x Axis on character

I am creating an endless runner with a flying character. I want to lock any movement in the x axis so that the character object can only move up and down but still move forward through the scene. I ...
0
votes
1answer
72 views

How to deal with a many to many relationship between objects

In my game, I keep a list of all clients currently connected to the server and a list of all actors in the game. Each actor is "relevant" ( currently replicating ) to 0 or many clients, and each ...
-1
votes
0answers
43 views

camera following with strange behavour

I'm not sure why my code doesn't work.When I run it my camera just rockets off into space. using UnityEngine; using System.Collections; public class CameraFollow : MonoBehaviour { public ...
0
votes
2answers
65 views

Need Help with Hovering Mouse Code

I am new to Unity and C#. I have a script here for a card game where my card is supposed to move up and down when the pointer is hovered over the card. But when my point hovers over each card, they ...
0
votes
0answers
51 views

Store Player Stats

My character creation order is: Select Race, Select Class, Assign Bonus Stat Points, Customize and Name the character. Because I am using Unity's UI components I am using scripts attached to empty ...
0
votes
1answer
26 views

Adding a function call to a prefabbed button in Unity

For each of my scenes, I have an empty GameObject _Manager that stores my scripts for setting up the level, keeping track of variables, etc. On my main screen, I have a play button that isn't ...
0
votes
0answers
12 views

Unity Asset Prefab Bug ThirdPersonController (left rotating bug) Unity 5.1.1f

I've been struggling on this for an entire week. There is a very annoying bug in the ThirdPersonController Prefab. Take a look at this video for better understanding. Once I turned 360° degree I ...
-1
votes
1answer
39 views

Cloning a gameObject which use properties similar to original gameobject

How to make clone of gameobject have the same properties as the original gameobject just placed right to it and the clone should fire exactly parallel to original character. Every property should be ...
0
votes
0answers
44 views

Cell Loading System / Efficient Instantiation

|Summary| So essentially I am looking to create a system where the world is split up into cells. By cells I mean a square in the world that as the player approaches or retreats it decides if the ...
0
votes
2answers
76 views

What are the steps to instantiate a button in Unity?

Given a Canvas test_canvas containing a Button test_button and an empty GameObject that manages instantiation and scripts and the like called test_manager, what are the steps to instantiate this ...
1
vote
0answers
39 views

Calculating orbital elements from Cartesian Vectors

I'm having serious troubles with getting my calculations to work. I'm calculating the orbital elements from a position vector, and a velocity vector. (I also know the distance and mass of the bodies ...
2
votes
0answers
58 views

360 Degree Snake [closed]

I'm using Unity / C# to make a variation on a 360-degree snake game, but I'm having trouble just getting the movement of the tail right (I have a similar problem as in this question: How To Approach ...