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
20 views

Real-time movement client to server to client(s)

So the way that I tried to create a MMO like server communication was by sending strings to every-player containing information and making the client split the string. Example "John" , 42, 64 : ...
-1
votes
0answers
21 views

Right-side weapon rotate to face the mouse target

I have a 3D game looking from top to bottom where I move the mouse to aim at targets. I have a simple box (the player) with a sphere on its middle-front (that is the pistol) and a cylinder on its ...
0
votes
1answer
49 views

Best way to manage weapons as GameObject on a script in Unity with C#

I have a player game-object with a script Player. In the Player script I have a public properties weapons. I want to have to just drag in this properties a script/prefabs. And the Player script must ...
0
votes
1answer
58 views

2D Infinite Runner: how to manage the generation of dynamic terrain?

I'm creating a infinite runner game with Unity3d, i've been using math to generate the terrain by calculating the size/pos of the terrain and place the new one next to it, and it's working correctly, ...
2
votes
1answer
62 views

How animated block in voxel engine?

In my voxel engine (XNA 4.0) I'm use a vertex buffer for the entire chunk and update it after the set block, changing block metadata or light level. This is not too frequent operation compared with ...
1
vote
2answers
140 views

Render sprites onto a virtual 640x480 “screen”

I'm making a game, and in part of it, the player uses a computer terminal. I want to draw to a virtual 640x480 screen with pixel precision, and then draw that "virtual screen" to the player's real ...
0
votes
2answers
42 views

Advice on how to store level design info?

I'm building a 2D tile-based puzzle game in C#, using Monogame. The game board is an 8x6 grid of tiles, each of which can contain a number of objects. Conveniently, the number of possibilities for ...
0
votes
1answer
47 views

The more appropriate way to find GameObject in the scene

Which way is the more appropriate to find GameObject in the scene. I know that GameObject.FindGameObjectWithTag is faster than GameObject.Find but i wondering whether FindGameObjectWithTag is better ...
0
votes
0answers
27 views

Pass-through pixel shader not displaying properly

I'm new to shaders, HLSL and XNA in general. I'm trying to write a pass-through pixel shader but I'm experiencing some odd behaviour. I created a simple texture, shown below: Here's what I see when ...
0
votes
0answers
64 views

How Can I Make These Collisions Work Outside Of Unity's Built-In? (C#)

I'm having some trouble working out what's wrong with my code. Basically I want to have my player be able to collide with obstacles it's flying through. So I have an obstacle, and a pathway or two ...
0
votes
1answer
25 views

Uncontrollable platform spawning

I made simple spawner like this: void Update() { if (PlatformPosition.spawnNewPlatform) { NewPlatform(); } } public void NewPlatform() { if (active) { newTransform = ...
1
vote
2answers
53 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 ...
1
vote
1answer
75 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
14 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
29 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
34 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
24 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
23 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
52 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
25 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
39 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
37 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
41 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
41 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
16 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
50 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
53 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
1answer
45 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 ...
3
votes
1answer
76 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
18 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
24 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
78 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
47 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
22 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
38 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
10 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
160 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
77 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
13 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
17 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
61 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 ...