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

Z axis for player movement is being incremented, but i don't know how

I'm currently learning and developing a 2D plataform game in Unity, but now i'm having some errors that i can't solve. When I press the arrow keys to make my character move right and left, the Z axis ...
0
votes
1answer
13 views

XNA My Texture's Transparency is shown Black

I am trying to draw an image on to the screen. My image is drawn correctly but the background color which is transparent is shown black. Why is this so? My code: spriteBatch.Draw(Texture, Position + ...
0
votes
1answer
14 views

MonoGame in GTK#

I was wondering if it's possible to embed a MonoGame instance not in the standard window, but rather in a GTK# widget. If yes, how could I do it? Do I have to write a custom widget? Is it even better ...
0
votes
0answers
20 views

How do i need to start developing my first android game? [on hold]

I have experience in XNA and I want to develop Android game, I do not know where I have to turn ... There is a way to develop Android game in XNA or even Monogame to Andorid? (It is important that ...
0
votes
1answer
109 views

Loading Song in MonoGame Windows

I cannot load the song into my game. I got error in both templates WindowsDX and WindowsGL. Monogame Develop Build 1252 Both files .wma and .xnb are exist in Content folder and Build Actions are sets ...
-1
votes
1answer
56 views

Will Unity automatically scale everything? Please help!

I don't have a GUI or anything. Just a bunch of game objects with pictures on them. I want everything to scale with the size of the screen. So if it's a small screen, the character will take up less ...
0
votes
0answers
37 views

Performance issues when dynamically rendering playing cards [on hold]

My issue that I've ran into deals with the way I want to do the cards. I want to draw to a texture everything about the card then scale it down storing it into a texture to use to draw for the game so ...
0
votes
1answer
21 views

Unity3D Strafing Left & Right

I am trying to set my character up to strafe left and right and have 2 different animations, on for left and one for right, so far what i have written allows me to strafe left or right but it only ...
0
votes
1answer
23 views

Mirroring a game object to create symmetry

I have a GameObject with a primitive shape that I call "body". I want to create and add a child to it with another primitive shape. I call it 'mutation'. But i want to duplicate the 'mutation' and ...
0
votes
1answer
74 views

Problems with Raycasting Requirements

Im working on a script which kinda works like an Enemy AI. Its kinda like a detection system with requirements that are required to be met. This is a recent question i asked using my code Raycast ...
0
votes
3answers
62 views

Drawing 3D cubes with xna

I managed to draw a 3d cube using triangles like this: protected override void LoadContent() { basicEffect = new BasicEffect(GraphicsDevice); VertexPositionColor[] ...
2
votes
0answers
34 views

Questions about scaling in a 2d game in unity

Okay, so: I am making an android game. I want everything to scale to the size of the screen I'm using. Further, my static background needs to scale (as well as every other object), but if the aspect ...
1
vote
1answer
352 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 ...
1
vote
1answer
25 views

Check if object is overlapping

I have two objects, both of them with polygon colliders. When I click on one of the objects, I want the player to drag it on top of the other object (without collision). If there is overlap when he ...
0
votes
2answers
35 views

Refer to a gameobject on start

So I want my script to set the initial position of an object depending on the size of the screen and whatever. How do I refer to the gameobject? I know you can modify stuff like their location if the ...
5
votes
4answers
709 views

Creating an in-game time system only works with real time

I'm trying to create an in-game time system. Thus far it only works properly if you use 1440 minutes to the day (realtime), but I would like to be able to alter the day length to something like 10 ...
0
votes
1answer
127 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 ...
0
votes
1answer
65 views

A* Pathfinding for Procedural Platformer Levels

Im trying to write code a my Procedural Platformer Game , but i have no idea where to start. Ive looked up A* Pathfinding in general, but i cant seem to find A* Pathfinding with Procedural Platformer ...
0
votes
0answers
9 views

Pooling server list from unity's masterserver

I'm making my own server (C#), that will run separately from the unity game. So that you can host a server while not playing. I could create my own master server, but is it possible and how would I ...
1
vote
1answer
40 views

Changing Light Intensity value

I have this code for creating a light: GameObject lightGameObject = new GameObject ("Light1"); lightGameObject.AddComponent (typeof(Light)); ...
0
votes
1answer
238 views

Smooth rotation [duplicate]

I would like to rotate my Player very smooth. At the moment the player stops rotating when I release the button. Also the rotation should get faster, if the player rotates longer. I use XNA and have ...
9
votes
2answers
251 views

Interpolating between two networked states?

I have many entities on the client side that are simulated (their velocities are added to their positions on a per frame basis) and I let them dead reckon themselves. They send updates about where ...
5
votes
1answer
888 views

Smoothing Heightmap Data

I've made a Heightmap Generator that creates island heightmaps like in this picture: I am dividing the grayscale ( 0 - 255 ) into 4 diferent parts ( water, sand, gras and forrest ) and after ...
0
votes
1answer
56 views

Can't play animation from script in unity

I'm making a 2D sidescrolling game in Unity, and when the player shoots an obstacle, I want the obstacle animation to play and then destroy itself. I got it to destroy itself, but the animation won't ...
0
votes
1answer
30 views

Can’t Load .fbx from blender to Monogame correctly

I am using pipeline.exe tool, to convert an .fbx file I made using Blender (using the default Blender 2.73a export settings) to .xnb, and then manually copy and paste it in my content directory (Is ...
0
votes
1answer
60 views

Raycast Flashing problem

Can anyone tell me what is wrong with me code ? If you can see, whenever the player is in range of the raycast. The enemy turns red. But for some reason. Even when the player has meet the requirement ...
1
vote
1answer
35 views

Unity import text or json

Can't seem to find a definitive way to import text to C# in Unity3d. I'm looking to import either a lot of different text files or one large json file to represent all the text in the game. Thanks ...
2
votes
2answers
92 views

Jumping higher when the player touches a trigger collider in Unity

Im using Unity engine to create a 2D platformer. My character can single/double jump, this works fine everywhere except when i am in range of a collider with a IsTrigger set to TRUE, then my character ...
4
votes
1answer
199 views

Cubic bezier for easing?

I would like to find out what Y is if X is a certain number from a cubic bezier curve to make a custom easing function, like it's done on this site: http://cubic-bezier.com/ Does anyone know a formula ...
1
vote
1answer
56 views

How do I let a game support different rule sets?

I'm making a MUD game engine that supports D&D , Pathfinder and other tabletop-RPG rule sets. I am starting to build out how characters interact with the world (e.g. dialog, battle, searching for ...
-1
votes
0answers
15 views

Why does Unity ignore my Debug extension method? [on hold]

I have created an extension method for Unity's Debug.Log using UnityEngine; public static class DebugExtension { public static void Log(this Debug debug, string label, object value) { ...
1
vote
1answer
37 views

How to call a method from another c# script using invoke?

I want to call a method from another script in my script using Invoke(),but unable to run it.How can i achieve this ? Following is my code - void Start () { int randNum; randNum = ...
0
votes
0answers
12 views

Game Center Leaderboards in Monogame

Do anyone know how to integrate a game center leaderboard in monogame framwork... I have searched high and low yet I haven't gotten any luck of finding articles that might help... Please direct to ...
0
votes
0answers
14 views

Displaying intersection by removing vertices

I am using WPF, using the MeshGeometry3D class to build up my model. I have 2 pipes intersecting each other, and I would like to remove the region of intersection (meaning erase the portion of pipe 1 ...
0
votes
1answer
33 views

How do I make this block go back to the left with another click?

This is the script I've written so far which makes the block move from the left of the screen to the right on a mouse click. What I want to achieve is for the block to move back to the left when I ...
0
votes
0answers
23 views

Adding Player Movement and Firing on Touch Input (Unity)

I am having many problems with this. I am a new game developer and I am using a Unity tutorial. But I want to add touch input for movement and a touch button for firing the weapon. How can I do this? ...
1
vote
1answer
5k views

Enter Key press event detect from textbox - Unity3D - C#

i am doing a project with Unity3D . in the interface there is a textbox. once user input some text and and press enter key then i want to read the text in text box. so please tell me how to ...
0
votes
2answers
39 views

Using shader for cubes

I am trying to use a shader to get an effect like this. Notice how every cube has exactly the same lightning as every other no matter where it is on the screen if you look closely the lightning is ...
0
votes
1answer
26 views

XNA draw texture/font and DrawIndexedPrimitives at the same time

When i Draw a texture2d or a font with spriteBatch and also draw GraphicsDevice.DrawIndexedPrimitives, the frame is draw weird SpriteBatch spriteBatch = new SpriteBatch(GraphicsDevice); BasicEffect ...
0
votes
1answer
37 views

Help with understanding “transform.root.GetComponent<>” in Unity

I'm reading through a tutorial for making an RTS in Unity, and in certain scripts it wants you to make a Player field and then OnStart(){ transform.root.GetComponent}. I am not quite getting what that ...
0
votes
0answers
22 views

Arrange Jumble Word into English Word

Actually I want to make a Game. Game is very simple. There are 5*5 matrix with Jumble words and player needs to arrange those words into proper English Word. I have done small part of ...
0
votes
1answer
76 views

How to access multiple 2DTexture which is assigned in Unity3D inspector panel created by an array in C#?

I am making a puzzle game, i made 5X5 cube, lets take example of orange. very left column is orange, upper with orange dot is static and lower with orange dot is also static. inbetween there are 3 ...
0
votes
2answers
516 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 ...
1
vote
2answers
149 views

How to show my XNA game in form C#

I have a game in XNA, I want to connect this game with WindowForm to show for example the distance and the position. I tried to apply many tutorials that talking about this. but here is my problem : ...
0
votes
1answer
123 views

Best way to go about collision between rectangle and bool array containing pixel data?

Basically, if I have an array along the lines of bool[] collision; Filled with a value for each pixel in the sprite I am checking collision against (pixel 1 = true, pixel 2 = false etc), how do ...
0
votes
1answer
88 views

How to get display resolution (screen size)?

How to get display resolution in XNA/Monogame ? I tried these on my monitor (1600x900): The below give me 800,600 //1. GraphicsDevice.DisplayMode.Width GraphicsDevice.DisplayMode.Height //2. ...
2
votes
2answers
151 views

How can you subscribe to Unity input events, instead of polling for them

Been trying for days to figure out if there is a way to subscribe to keyboard/mouse events in unity. Instead of having to poll for them every frame and make my own events. Right now I poll through ...
0
votes
2answers
66 views

Accessing colliders from one script C#

I want to access specific colliders(to see if they are been clicked) from one script insted of making multiple scripts for every collider.How? I am using unity. using UnityEngine; using ...
0
votes
1answer
65 views

Unity, Why a Text object can't be edited?

I have an input field and event that calls a function when I press enter. public Text theText; I take the Text part of the input field (connect them in editor), display the content and set new ...
1
vote
2answers
57 views

Unity prefab script “GameObjects” can't be ones on the scene?

Currently, I have an object on the scene, and one in prefab. I want the prefab's script to reference to the object on the scene through the public GameObject obj; code. However, when I tried to ...