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

Non Graphical Collusion

pretty new to gamedev stuff and really sure if this is actually a game dev question! Basically, I have been looking for resources/advice on what I need and how. I am creating a game, where a user ...
0
votes
0answers
18 views

Unable to Set Text of another Text Object

The Idea: Pressing a button in the canvas will allow the player to select a race. A script is attached to an object which is accessed though the OnClick() function of the button. The script is ...
3
votes
1answer
30 views

How can I make a scrollable text view?

I am trying to do an appication in monogame windows. I have a long text to be displayed on screen. I tried to render it on screen using spriteBatch.Drawstring, was succesful to an extent. But, the ...
-1
votes
1answer
23 views

Unity Ui slider volume control

I have the ui slider to control my volume, I have my slider to control all the volume of the game. I have make it so when the main slider change value all the other slider change with it but when I ...
0
votes
1answer
25 views

OpenTK Ray Picking

I just can't get ray picking to work (I need to drop old working faedback mode, and replace it with color pick, but because my scene can have up to 300K+ objects it is reasonable to filter (it's a ...
0
votes
1answer
23 views

Rectangle Collision Not Correct

As you can see on the top corner it says COL: False/True. This is if the player bounds and the tiles which are solids. The rectangles for the tiles and players are checked if they intercept ...
2
votes
1answer
55 views

Change in direction should slow down object and accelerate in new heading

I'm trying to implement some sort of faux space physics in my 2D game. I have a top down view of my space ship. You can change direction and set a speed up to a maximum which then accelerates the ship ...
1
vote
0answers
15 views

Monogame - Not enough storage is available to complete this operation, on backgrounds

I am making a level selector, which works like a web slider. I am showing 12 levels per page, and I have a total number of 60, which means 5 pages of 12 levels. Each level has his on background ...
0
votes
1answer
62 views

How to create a state based traffic signal?

I want to create a traffic light for a Unity3D game. I will model it in blender. What is the best way to control this light in a unity scene? One way I could think of is to change texture of say ...
0
votes
1answer
39 views

Player rotation issues (Player returns to default forward rotation after releasing keys)

So basically what is happening is that my player rotates and faces the direction that he is currently being steered toward (which is wonderful). But after I release, let's say the A key, meaning he is ...
2
votes
1answer
99 views

TopDown Island Generation

I am trying to generate an island using Simplex Noise. To actually make a island shape i used Amitp's answers to the following questions: 1.Fast, simple procedural 2d island generation 2.Generating ...
1
vote
1answer
35 views

How to detect collision position and that position's texture color in Unity?

I have a prefab and I use Circlecollider2D for physics operations. I want to detect the color of the contact position of the collided objects ? Is is possible by using Unity's collider classes ?
-4
votes
0answers
74 views

Unity - C# How to create very Big Number?

public static float a = 9999999999999999999; This is the biggest variable that can create. but is not enough for me I need to get to this public static float a = ...
0
votes
1answer
45 views

Unity 5 Client RPC call: Failed to Invoke ClientRpc

I have a Unity 5 client and server running. On the server a path is generated and I want the client to receive the position of each target node on this path. Following the Client RPC calls section ...
0
votes
1answer
16 views

Audio slider doesn't change value

For some reason, my slider and audio resets back to 0 when I stop and play the game after I changed the value. Here is the code, I can't spot anything wrong with it: using UnityEngine; using ...
0
votes
1answer
36 views

Gravity not being applied to character, using character controller

So I just copy and pasted the unity example class to use with my character controller. public float speed = 6.0F; public float jumpSpeed = 8.0F; public float gravity = 20.0F; private Vector3 ...
0
votes
0answers
24 views

How to programmatically change sprite sheet sub-sprite name

I am trying to change the name of the sub-sprites of a sprite sheet. I have searched and tried everything I can think of and cannot get it to work, which makes me think it can't be done at this point ...
1
vote
0answers
66 views

Unity (C#): How can I create dialogue to be used in my game? (also critique my system?)

I've created my own system for handling dialogue. There's a class for each 'node' or part of dialogue. It contains the following variables: identifier (identifiers are unique for each NPC, but not ...
1
vote
1answer
22 views

Adding shadow and other effects on a spritefont Monogame

Is there a way that I can add shadow effect on text drawn in monogame? Because you cannot add shadow effect when creating a new spritefont file in Monogame Content Pipeline. Thanks.
0
votes
1answer
41 views

Monogame / XNA - Multple 2D Cameras (Rectangle) on screen

I recently started building a simple 2D roguelike game using Monogame 3.4. I was keen on building the game "engine" myself as I saw it as a fun learning curve. Monogame was pretty much the best option ...
0
votes
0answers
21 views

Rotation before scaling image/Lower resolution rotation? (XNA/C#)

Currently, when I rotate the image using SpriteBatch.Draw() the image is rotated after it is scaled. Resulting in: Which is using the code public override void Draw(GameTime gameTime) { ...
0
votes
0answers
13 views

SerializedPropertyBindings NullReferenceException

Using: Unity 4.6.1 Pro Visual Studio 2013 Pro, c# Team Foundation Connected to git vc Windows 7 Premium Building 2D iOS app (2D set up) Details: Periodically, this error is occurring. There ...
0
votes
0answers
60 views

Tutorial System in Unity C#

I am having trouble creating a tutorial level for my game in Unity. The first problem is efficiency. I have a script below, which displays the dialogue. And I want to know the best way to create goals ...
0
votes
1answer
31 views

How do I make one ui slider control all of the game audio?

I use the ui slider to control how loud is the game, what I want to know is how to make one ui slider control all of the game audio?
0
votes
1answer
50 views

Circle Depth Penetration

I'm resolving some collision between circles and I keep getting this problem. Note: The rectangles are perfect squares fitting the circles so when I type rect.Width I mean the radius of the circle. ...
0
votes
1answer
23 views

How do I use playerprefs to make ui slider keep the sound settings?

I have not use playerprefs before, I want to know how to keep the change of the audio when the player change it throughout the game.
1
vote
1answer
22 views

Function messages wont send when identical conditions will message to activate another function

So in working with my game, there aren't any syntax or compile errors, but there's this one bug that I've been working on to fix for a few days on and off and I can't seem to make heads or tails of ...
1
vote
3answers
70 views

In Unity, how do I make separate mute buttons for sound-effects and music?

I'd like to have a button to mute game sounds and another to stop the game music. How can I do this?
1
vote
2answers
42 views

Best practice for scrollable viewport rendering

I am working on a tile based game that renders the playing surface in a viewport. I am struggling with getting my head around the mechanics and best practices of rendering a viewport, specifically a ...
0
votes
1answer
35 views

Enemy Follow Player Orthogonal Movement

I have a Enemy class that Seeks a player if he is in his field of view. Problem is i want the enemy only to move up/down/right/left, not like for example up and left at the same time (diagonal ...
1
vote
1answer
50 views

Generating mesh along path

I'm currently trying to generate a path along an array of points(Vector3) This is the result i'm currently getting The dark gray points are the given path The red points are the generated verticies ...
0
votes
1answer
45 views

Unity C# new Vector3 problem

I get an error every time I try making a line with "new Vector3". Example 1: private Vector3 playerPos = new Vector3 (0, .5, 0); gives the error: The best overload method match for ...
1
vote
3answers
91 views

Story game loop [closed]

I have been playing story based games such as lifeline or choice of games. I was wondering what game loop best describes what's happening logically? As when mauling over it myself in my head I am ...
1
vote
1answer
37 views

Double Jump causing problems?

Here is my code. I have an empty Gameobject directly underneath the child with a small radius checking the ground every thing seems to be correctly covered, but for some reason the jumping mechanic is ...
2
votes
1answer
65 views

Problem with Rotation - C#/XNA

I have a projecile(Hook) and the tail of the projectile(yellow balls) TailProjectile class draws a ball at the exact position of the projectile(hook) and let it there until the projectile ends I'd ...
2
votes
2answers
58 views

Unity2D: Rendering multiple sprites as a single one

I'm creating NPCs in Unity 2D using C#, and I have 16x16 sprites for body, helmet, clothes and weapon. All these have a tile set which has been split in unity. I'd like to be able to render one of ...
0
votes
2answers
72 views

WaitforSeconds() not working as it should

I searched for using WaitforSeconds and used as it was mentioned(using a return type of IEnumeration and using coroutines instead of update). but it did not work. Initially it showed Waitfor Seconds ...
0
votes
0answers
50 views

Using an object as a model to avoid too many parameters - XNA/C#

I have 3 classes(Skill,Projectile and Status),Skill has Projectile and Projectile has Status, all of them need to read information from a txt and to avoid open it everytime I want to create an object ...
0
votes
1answer
36 views

Is it possible to load asset bundle dependencies manually in Unity 5.0?

Is it possible to tell Unity to not load asset bundle dependencies automatically so they can be loaded manually. If so, how can this be done?
1
vote
1answer
87 views

Keyboard.GetState() only work first time, and Memory increase (not Disposing)

EDIT UPDATE 3 I been searching the web for a solution and found several people struggling with Memoryleak using MonoGame while trying to dispose objects. It could be the case that MonoGame should be ...
2
votes
1answer
68 views

Determine if AI can traverse a given spline

I have some AI Agents that I want to navigate along a spline. The agents have a speed and a maximum turning radius. For some splines the curvature is too tight for the AI agents to navigate around and ...
1
vote
1answer
51 views

How does Unity load asset bundle dependencies and how can they be accessed?

Loading assets from an asset bundle is done explicitly. You give the bundle the name of the asset to load, then it returns it( either now or later. ) However, loading dependencies is done completely ...
0
votes
1answer
22 views

An object reference is required to access non-static member UnityEngine.Material.GetTextureOffset(string)

I am watching a tutorial where it seem to work. But in my case, I am getting this error. I get it that non-static members have to have an object. But, I don't know much about how to fix this error. ...
0
votes
1answer
51 views

Restricting my horizontal slash attack

I've been working on making this slash attack for my character in the unity engine. The whole point to this script is to put the damage range in sync with the slashing animation. The slash is ...
3
votes
2answers
47 views

XNA/C# Convert polygons into tilemap

I'm currently working on my 2D survival game, where the world is infinite and generated by perlin noise. I wanted to also include biomes and this article interested me - ...
0
votes
0answers
11 views

How to parse animation data of a .x file in SlimDX

I have a managed Direct3D9 application that uses SlimDX. I need to implement a custom animation controller. I want to parse the .x file for animation data. The SlimDX.Direct3D9.XFile and ...
0
votes
1answer
51 views

Why isn't OnTriggerExit working?

I have a price of code that looks like this: void OnTriggerExit() { Debug.Log("Object leaved trigger"); } But when I move an object that is colliding with the trigger by script it doesn't print to ...
1
vote
2answers
62 views

How to freeze rotation with a Rigidbody 2D? [closed]

So I am looking to freeze rotation in the Y axis on a Rigidbody 2D. I'm not sure how to set this in my code. This is what I have so far, can you point out my errors? public class PlayerMovement : ...
-1
votes
1answer
85 views

How to optimize my movement & collision code?

I am trying to implement movement & collision the simplest way possible. public void MovePlayer() { KeyboardState keyState = Keyboard.GetState(); Vector2 checkVec = ...
0
votes
1answer
55 views

Unity Transform.Position not returning expected position

So in my scene hierarchy, I have an object laid out like so; -Level1 --Level2 ---Level3 ----Level4 My script is attached to the Level1 object. When I try to find the transform.position of Level4 by ...