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
votes
0answers
28 views

Content is null

I finally got the tileset to work, but after I got it working I was hit with a a content null error. Which is from: this.content = new ContentManager(content.ServiceProvider, "Content"); The first ...
0
votes
0answers
16 views

Multiple tile drawing in monogame is slow

So I have this drawing function (which is by the way recomended as an solution here). It draws tiles on the whole window with no problem but my game slows down to ~30fps after maximizing it to ...
-1
votes
1answer
30 views

Using multiple strings within the path to Write to Text File [on hold]

In Unity3D, How would I use something like this: path = "C:\Users\Jonathan\Documents\FileData" + fileName + ".txt"; so I can make a for loop and create several text files under desired path? The loop ...
5
votes
1answer
640 views

Should the networking of my game be a component or a service?

I am working on a windows game and I am trying to understand the XNA GameComponents and GameServices classes and use. From what I understand about a component is that it has an Update method that ...
0
votes
1answer
86 views

Multiple joysticks event handling

I want to make a game which is totally same idea as "Who pressed the button answers the question". I have 2 joysticks and both are connected to a pc. My application will be Winforms and I will ...
0
votes
0answers
15 views

C# XNA 2D Tile Lighting Problems [on hold]

Hi guys im trying to implement 2d smooth lighting effect like terraria.But there is some issues like this: http://oi61.tinypic.com/2udwdy0.jpg Border blocks has 0 light, why i dont know. ...
0
votes
1answer
145 views

Angled topdown perspective camera for 2.5d game

I have a 2d tile based game created using Unity's 2d tools and orthographic camera: The tiles are created by programmatically generating a mesh, assigning a texture to each pair of triangles, and ...
0
votes
0answers
18 views

How to access base class from within subclass? [migrated]

I have an abstract class called BaseMonster. This "base" class holds several values, such as float dyingTime =2, that will be the same for all monster subclasses. But since there are a lot of values ...
3
votes
4answers
216 views

RPG like hit points growth algorithms help

I am currently making an XNA game in C#. I want to increase health as the player level up. I am currently using this equation. MaxHealth = Convert.ToInt32(100 * Math.Pow(1.17, level - 1)); Its ...
0
votes
2answers
34 views

Performance Difference Between Content.Load and Texture.FromStream xna

Is there any performance difference between Texture2Ds loaded using the content pipeline and Texture2Ds loaded using Texture2D.FromStream()?
0
votes
1answer
67 views

How to inplement a save-system for a complex nested list of character classs?

This is the situation I'm in: I'm developing a game with C# using unity. In the game I have characters which is either locked or unlocked, and they're pretty much the same. For every character, they ...
0
votes
1answer
38 views

Unity 2D, C# - Make object move diagonally by a certain angle?

I have a sprite object which I want to move in 8 directions. Left, Right, Up, Down, Left top, Right top, Left down, Right down. The view is 2D with a isometric projection. The difficulties I am ...
0
votes
1answer
59 views

Collision detection doesn't register until player sprite jumps

I have implemented a shooting mechanic into my game, and the act of shooting works fine. The shooting work is done in my "game1" class. The issue that arises is when I incorporate collision detection ...
-1
votes
1answer
22 views

Moving an object continuously when left or right key is pressed

I want the object to move continuously as long as key is pressed to left when left arrow is pressed and to right when right arrow is pressed. Instead of moving continuously it moves first time and ...
0
votes
1answer
26 views

Incosistent jump, stuttering

I've written this C# code to handle movement in my testing project. The game is supposed to be 2D, some kind of a platformer, just to get me started with Unity. However, it seems there's something odd ...
6
votes
2answers
340 views

How can I debug live multiplayer servers effectively?

I have a multiplayer server made by a small team of developers and we have bugs that crop up on our live server occasionally that we simply can't reproduce while playing with our small team on a live ...
2
votes
0answers
31 views

Wall-sliding Collision Response Only Works On One Axis (2D)

"sprite" is the player object, velocity is a Vec2 that tracks movement (is set to -1, 1, or 0 at any given time), each sprite in "sprites" is a wall of the same size as the player (everyone is a block ...
-1
votes
2answers
64 views

how would I go on about making a movement system like mario party

main question how would i go about getting a movement system similar to the one they have on mario party only minus the dice roll things i have researched so I have been studying the uses for ...
1
vote
0answers
53 views

How to use an A* Pathfinding System across uneven environments?

I am developing a game in Unity3D. I want an enemy character to follow the player around. The problem is, my surface is uneven and full of mountains. I am using aarongranberg's pathfinding project. ...
0
votes
2answers
30 views

Monobehaviour can not find a member OfType in Unity

This is the line where I am getting above mentioned error: var listeners = FindObjectOfType<MonoBehaviour> ().OfType<iPlayerRespawnListener> (); I have already imported these libraries ...
1
vote
3answers
151 views

How to create sprites, programatically without using prefabs?

I have different types of images for different sprites. and i am not certain that how much different sprites(images) i will have to show. So, i gotta create the sprites and apply textures ...
-2
votes
1answer
26 views

animation problem on player movement ( unity ) [on hold]

I atached these script to the player . And added animations. And it moving perfectly, but the problem is when i click play, it playing the moveP animation automatically. How can i make it. If i ...
0
votes
1answer
139 views

Farseer: How can I create a body with a hole in the middle

I want to create a shape that looks like the black contour in this picture: The shape must be empty in the middle(white surface). The white surface must not be part of the shape, just the black ...
0
votes
1answer
27 views

How to retarget monogame solution vs2012

Im currently having a bit of trouble testing my multiplatform game. It originally started as an android project in monogame has extended to windows 8 and WP8. I'd like to test our the win 8 port, but ...
-1
votes
1answer
120 views

Disabling / Enabling object renderers on click

I am working on unity2d. I have six game objects: Object1, Object2, Object3 (these are images) ObjectImage1, ObjectImage2, ObjectImage3 (these are images). I have arranged the object in the scene ...
-1
votes
0answers
76 views

How to fasten the avatar's feet on the ground

I'm developing a Kinect Project using C# and XNA 4.0.Now facing a problem that I couldn't solve. When the player bends to near side , the avatar's feet are leaving the ground and it is moving like ...
2
votes
2answers
349 views

Intelligently move aircraft using curves

I am trying to code a script to move an aircraft entity from point A to point B and at some point in the middle of moving have the aircraft forward vector face Point C (to fire a missile at an enemy ...
0
votes
2answers
95 views

Set new forward directions based on camera position

I have a 3rd person camera which can rotate around the player. When I look at the back of the player and press forward, player goes forward. Then I rotate 360 around the player and "forward ...
0
votes
0answers
43 views

How to block Kinect rotation

I'm developing a Kinect Project using C# and XNA 4.0. Now facing a problem that I couldn't solve. When the player turn around himself, the avatar doesn't turn, but its arms and legs are trying to ...
1
vote
2answers
316 views

How do you map a texture to a sphere in Unity using script?

I am looking to map a texture to a sphere inside of Unity using c# (not in the visual editor)? dragging a jpg or other image resource onto the sphere is the effect I am looking for -- but I would ...
0
votes
1answer
106 views

What is the best type of c# timer to use with a Unity game that uses many timers simultaneously?

I am developing a stand-alone 3d game in Unity that will have anywhere from 1 to 200 timers running simultaneously. There will be a GameObject containing 1 timer. For this game timer durations will ...
0
votes
2answers
53 views

Unity, Unrealistic Sphere On Inclined Plane

So I am trying to model a ball rolling down an inclined surface in Unity based on what I am observing in real life but it is still quite off. In Unity it takes the ball about 3 seconds to travel ...
0
votes
0answers
17 views

create a bounding object for flat model [closed]

I have a flat textured ground representing my terrain and a bounding ssphere which surrounds my player. When i jump, i set my y distance to stop decreasing when i reach a certain point. But this ...
0
votes
1answer
192 views

Make Gameobject Stand On Surface Facing Certain Direction

I want to make a biped character stand on any surface I click on. Surfaces have up vectors of any of positive or negative X,Y,Z. So imagine a cube with each face being a gameobject whose up vector ...
1
vote
0answers
43 views

Having a hard time having consecutive animations for an attack [closed]

So I've been trying to figure this out for about 8 hours now...It's driving me nuts because I am pretty sure that it is something dead simple that I am just not understanding. I had everything working ...
1
vote
1answer
70 views

How to make an object move again after being stopped by collision in Unity?

I have a player object which position is always centered on the main camera's viewport. This object has a Rigidbody 2D, a box and circle collider. The player moves around a level, the level has a ...
0
votes
1answer
114 views

Simple heart container script for 2D game (Unity)?

I'm attempting to create a simple mobile game (C#) that involves a simple three-heart life system. After searching for hours online, many of the solutions use OnGUI (which is apparently horrible for ...
-1
votes
0answers
36 views

How to end game properly in unity? [duplicate]

I have made a game in unity free. The game is functioning properly but if your computer receives any kind of notification, the game minimizes automatically and stops to work completely. Along with ...
0
votes
1answer
114 views

Why is my Simplex Noise appearing in four columns?

I'm trying to make a Texture out of Simplex noise, but it keeps appearing like this regardless of how big or small scale is: The following code is used to produce the image's color date: private ...
-1
votes
1answer
33 views

How to use lemodev highscore plugin for unity?

I am trying to add a server-sided highscore system to my game in unity. I have downloaded the free lemodev highscore plugin from the asset store but I cant figure out how to use it. I know where to ...
3
votes
1answer
289 views

Jittery Movement, Uncontrollably Rotating + Front of Sprite?

So I've been looking around to try and figure out how I make my sprite face my mouse. So far the sprite moves to where my mouse is by some vector math. Now I'd like it to rotate and face the mouse as ...
0
votes
1answer
166 views

Moving player in direciton camera is facing

I have a 3rd person camera which can rotate around the player. My problem is that wherever camera is facing, players forward is always the same direction. For example when camera is facing the right ...
1
vote
1answer
70 views

Vehicle: Boat accelerating and turning in Unity

I'm trying to make a player-controllable boat in Unity and I'm running into problems with my code. 1) I want to make the boat to accelerate and decelerate steadily instead of simply moving the speed ...
0
votes
1answer
52 views

touch in guiTexture

Before time in my game start. i want there will show a guiTexture.. if i touch this guiTexture, that will hidden and the time game will start. I try to make a script but it doesn't work. I'm a bit ...
1
vote
1answer
61 views

Collisions and Lists [closed]

I've run into an issue that breaks my collisions. Here's my method: Gather Input Project Rectangle Check for intersection and ispassable Update The update method is built on object_position * ...
3
votes
1answer
71 views

Character creation using spritesheets

I am currently creating a 2D fighting game and have implemented a system where upon starting a new game, the player is presented with the option to create a custom character. I have a set of string ...
1
vote
1answer
134 views

Render 2 images that uses different shaders

Based on the giawa/nehe tutorials, how can I render 2 images with different shaders. I'm pretty new to OpenGl and shaders so I'm not completely sure whats happening in my code, but I think the shaders ...
1
vote
1answer
75 views

change texture at runtime

How can I change the texture at runtime. I have done changing the label(text) at runtime. The following code is used using UnityEngine; using System.Collections; public class switchtime : ...
0
votes
1answer
102 views

Converting a GameObject method call from UnityScript to C#

Here is the UnityScript implementation of the method i use to generate a randomly tiled background, the problem i'm having relates to how to translate the call to the newTile method in c#, so far i've ...
1
vote
1answer
57 views

Align tetrahedrons

I'm currently generating tetrahedron meshes in Unity When a player clicks the side of a mesh, a new one spawns aligned with it, like this. I'm not sure how nor can I find any information on ...