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

Failed to load QCARWrapper.dll

I am using unity 5.1.0f(64 bit) and Vuforia SDK Version: vuforia-unity-5-0-5 The web cam is operating normally in windows but in unity in Play Mode not. I am getting an error message "failed to ...
0
votes
2answers
1k views

How to make a gameobject Scale up from another GameObject script

I'm trying to make a GameObject grow in scale from touching this one, and when a set amount of scale is reached destroy this GameObject ( the one who scales up the other). My problem so far is that ...
0
votes
2answers
61 views

Finding Game Object with Regular Expressions

Is there a way to use a Regular expression in the GameObject.Find() method? I'm making a checkers game and I've got pieces named Red Piece (x,y) and White Piece (x,y) (where x & y are actual ...
4
votes
2answers
296 views

How to impale and stack targets correctly according to the collider and its coordinate?

I'm making another simple game, a catch game, where a spawning target game object must be captured using a skewer to impale it. Here how: At the start, the falling object (in red) will fall in a ...
0
votes
1answer
44 views

Opentk hdr rendering with framebuffer white screen problem

I am trying to do hdr rendering with two shader programs: one simply draws a hdr texture on a fullscreen quad and the other one does tonemapping. I am trying either linear tonemapping colorOut = ...
0
votes
2answers
123 views

Why are my click events being fired many times for every click?

I am working on a game in unity where a user will click a button to gain coins and clicks over a lifetime of clicking the button but the code is making the clicks go up by a lot instead of just 1 each ...
0
votes
2answers
213 views

Casting a directional line of which an object is coming from

I want to create a directional line ( curve / linear ) depending where the direction is coming from. In some games, similar to Angry Birds, a dotted guideline is shown to provide where the gameObject ...
3
votes
2answers
145 views

Bullet holes on curved surfaces and corners

So right now I am making an FPS game where the gun creates bullet holes (plane with texture) on impact, but there is a problem with that, if I shoot at the edge the plane will stick out and also ...
0
votes
1answer
147 views

How to stretch screen image to fit higher res monitors set to lower resolutions with Unity?

Using Screen.SetResolution(width, height, windowMode); , how might I stretch the image to match the monitor size? I've noticed this problem occurs both with this line of code and also the default ...
1
vote
1answer
216 views

Unity provides wrong Input value if game is started with bumpers pressed down

As the title states I am having an issue with the following. It is a pretty specific edge case but it is something I can't work around. In Unity I have created two Axes to allow me to check the value ...
1
vote
2answers
3k views

Octrees as data structure

In my cube world, I want to use octrees to represent my chunks of 20x20x20 cubes for frustum and occlusion culling. I understand how octrees work, I just dont know if I'm going about this the right ...
0
votes
1answer
167 views

How to refresh andoid photo gallery in unity

After saving a screenshot into the folder i cannot view the screenshot in the android gallery but can see the screenshot in the folder created.Is there anyway i can see it through gallery?
0
votes
0answers
32 views

Unity 3D - Tags not Working

I have triggers that interact with planes, each individual plane has a specific tag. The problem is, that it seems to just detect all planes but one called "Middle Plane" Here is the link of the ...
0
votes
1answer
2k views

How to make a top down shooter? [closed]

I want to know is with XNA 4.0 (and C#) How do I exactly make a top down shooter? I have been looking for ages, but have been unable to find out how. If someone could tell me how to get started with ...
8
votes
1answer
5k views

Where to start writing games, any tutorials or the like? [closed]

I'm actually an industrial systems developer with knowledge of .NET C# and VB.NET, C/C++, Delphi, and an intermediate knowledge of 80286 Intel assembly language. I would be interested to learn how to ...
2
votes
1answer
1k views

Getting started using C# and Physics (Resources, Tutorials, Samples, etc.) [closed]

As an application developer, I plan on now getting started in game development so I have come along to this site. I am a proficient C# developer so I guess it makes sense to start game development in ...
53
votes
7answers
7k views

What are the dangers of self-teaching game development? [closed]

I am about to embark upon a journey into game development. Following answers to my last question, I will be using C# and XNA. However, I don't personally know any other game developers and I don't ...
-1
votes
1answer
685 views

Where would I find C# flocking tutorials? [closed]

Been looking for a while now and finding it difficult to find a good tutorial... Where would I find a good tutorial on how to implement flocking in a C# XNA game? Something easy to understand .. for ...
0
votes
0answers
19 views

How to draw things on top of objects drawn in OnRenderObject()?

I am using Unity, here is the method in question. So I know this method draws objects after the camera is done rendering the scene. I have not come across a way in Unity to draw these objects in a ...
20
votes
11answers
4k views

XNA development tutorials [closed]

Can anybody guide me about where can I get the basic starter tutorials for developing using XNA framework?
0
votes
2answers
1k views

Tutorials for shadow mapping with multiple point lights in XNA [closed]

I've been trying to crack this problem for a while now and I'd like to know if there's a tutorial or two out there that can help me with this. I know how to do shadow mapping with a single light, and ...
0
votes
3answers
53 views

C# Integer limits for Scriptable Objects

I am experimenting with Scriptable Objects in Unity. In the following example how can I limit the range of accepted values? public class AScriptableObject : ScriptableObject { public uint damage; ...
3
votes
0answers
52 views

(Monogame) Camera does not travel the way it is rotated

I've implemented camera control with mouse and keyboard. My problem is that camera goes crazy when I'm using mouse and camera does not travel the way it is rotated. Could you explain me why and how to ...
1
vote
1answer
553 views

How to move rigidbody player to its facing direction with AddForce?

How can I move a rigidbody to its facing direction? I've already tried this: rigidbody.AddForce (transform.forward * v, ForceMode.Acceleration); // v is a public float which gets a new value in ...
-1
votes
1answer
40 views

GetComponent doesn't works

I have a Halo component on an object, on the same object I have a script, in the script I tried to get the Halo component, but the GetComponent< Halo >() doesn't work, it says that it can't be ...
1
vote
1answer
163 views

Ray & Segment Intersection

I'm writing some code to check intersection between all of a rectangles segments and a ray. It will sometimes use the Left and Right side of the rectangle as the closest face hit (face DA & BC) ...
0
votes
0answers
17 views

Setting a destination to Nav mesh agent but the character moves around the edges of the walkable area

I created a character. Added character controller, rigidbody and nav mesh agent. On right click I get the position clicked using raycasting and set the hit point as the destination for nav mesh ...
0
votes
2answers
32 views

Tag for Moving platform

My character is not sticking on the platform when jumping on it but I don't know why. Here is the code: void OnCollisionEnter2D(Collision2D other){ if (other.transform.tag == "MovingPlatform") { ...
0
votes
1answer
38 views

Is Update(GameTime) called before it's finished?

Code at the beginning of Update(GameTime) is being called over and over again, and code at the end of Update(GameTime) is only being called after a delay. Is Update(GameTime) called again before it's ...
1
vote
3answers
57 views

Unity 2D, how to turn a bool true, after a set amount of time?

I have an enemy working to damage the player when they stay in collision for too long, at the moment, the enemy will attack about 30 times per second, however I want there to be a delay between each ...
2
votes
1answer
1k views

Adding materials to a Line Renderer through code? (Unity)

I have a material that I am using to add a glowing effect to my line renderer. I can add this as a 2nd material to the line to give it a glowing effect. I want to be able to add/remove this material ...
0
votes
0answers
16 views

SharpDX.SharpDXException error when using vector as parameter

I placed a GraphicsDevice and width/height into the new RenderTarget2D parameters as it ask for but it keeps throwing an error. Does any one know why? Error: Additional information: HRESULT: ...
0
votes
3answers
37 views

Unity inspector script - making it save the global variables for what it's creating

I have a script which initialises a bunch of child gameObject(s). I wanted all of this to happen outside of the game, so I created an inspector script which has a button which triggers the method ...
2
votes
3answers
398 views

Camera follows player but how to stop camera moving when player moves

The player is moving automatically diagonally down the screen, and I have the camera as a child on the player. I would like the camera to always be following the player (who sometimes slows down / ...
0
votes
1answer
159 views

Continuous Jumping Cycle

The script makes a GameObject jump using realistic gravity and reach a specific target. The GameObject jumps relative to the target, thus adjusting its trajectory. It also works while the target point ...
0
votes
1answer
95 views

Different game resolutions on emulator and on a real device (which has the same resolution) on Windows Phone 8

I have a big problem with game resolution, when I'm running my game on emulator (which theoretically has the same resolution as my real windows phone device: 800 x 480). I'm making the game with ...
4
votes
1answer
279 views

How to save the Mesh from an Interactive Cloth at runtime in Unity?

At the start of a scene I have GameObject called 'sheet' positioned above a 'ball' GameObject. The sheet has an Interactive Cloth component on it and a Cloth Renderer. The Mesh for the Interactive ...
0
votes
1answer
364 views

Unity5 TextAsset not functioning in WebPlayer

Preface I am working on a 2D Platformer in Unity5 utilizing TileMap techniques. I have a working system to read "Room Tile Data" from JSON files with the Unity TextAsset Class and the Newtonsoft ...
0
votes
2answers
10k 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
0answers
15 views

Unity3D c# get animation playback position AFTER it is stopped

As title says, i'm having trouble determining playback position of legacy animation after it has normally finished playing or has been stopped. Here is a oversimplified demonstration: //how i get ...
0
votes
1answer
58 views

Code for inventory function not working

I'm working on an inventory, and I've ran into some problems. Some code in my CollisionDetection class doesn't work properly. My CollisionDetection class contains functions that involve mouse and ...
0
votes
1answer
22 views

Making Scene at editor mode

On Button click at editor mode I am trying to make a scene of selected Hierarchy game-object but the problem is as i click the button new scene become upon and I lost the scene where i were ...
0
votes
1answer
74 views

Zoom at a specific point using Orthographic camera

Currently I can perform Zoom which seems to be working fine but essentially what I'm really trying to do is zoom on a position offset from center as currently when I zoom then zoom is performed at the ...
0
votes
2answers
4k views

Play animation when click on each player with in maincamera unity3d

I have 3 gameobjects (player1, player2, player3). I attached a script "playerscript" to these game objects. In the main camera, I have added another script called "testscript". Clicking on a player ...
0
votes
1answer
133 views

How to load sprite from JSON?

i know how to load text, but idk how to load texture from json.. this my c#: public void soalbegin(){ filepath = System.IO.Path.Combine(Application.streamingAssetsPath, "soal.json"); ...
0
votes
3answers
337 views

Unity FP Character Can't Look Vertically

I have a FP Character and well, it can't look vertically. Its happened about 3 times now, each time I just replaced it with the standard assets prefab, first few times it worked fine, but then after a ...
0
votes
3answers
110 views

A method to create and assign a name to a GameObject (Unity)

I'm trying to create a function that takes in a name of an object in the editor and assigns this accordingly as well as the name of a sprite, rigidbody, etc. Basically what I have so far is- ...
6
votes
3answers
224 views

Understanding Scriptable Objects

I am trying to understand the logic and functionality behind Scriptable Objects. I 've watched the provided video 2 times and I keep getting lost. I tried to follow the code as well but with no luck. ...
0
votes
0answers
13 views

Script for Sprite Slicing works fine as a MonoBehaviour, but not as a normal class called in a Editor Script

I got a script for auto-slicing sprites from the internet. Link to the script. I made the script so that it is not a MonoBehaviour. Then i do this is my custom assets importer: private void ...
1
vote
1answer
60 views

Increase speed with each enemy destroyed?

I need some help with coding this idea: "For each Target destroyed, increase the Gunner's speed by (speed variable)". The idea is that the Gunner is automatically moving, and I want it to become more ...