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

storing/retrieving values in dynamically created button script

When I click the button why is the logged text not minion 999 (which is the values I passed in bc.Setup())? When I click the button it outputs the default text of test 6 main.cs using UnityEngine; ...
0
votes
0answers
24 views

Trying to do skeletal visualization in bind pose similar to blender with octahedral mode

I already achieved drawing octahedral by just porting blender code to c#+opentk. Here ported code: static float[][] bone_octahedral_verts =new float[6][] { new []{ 0.0f, 0.0f, 0.0f}, new []{ ...
0
votes
0answers
43 views

Getting a part of terrain from a bigger one

So I have a terain of size 8192*8192. And I want to get a part of it as its own terrain. I have created a function that gets height needed for terrain, but it just minimizes the whole terrain. The ...
0
votes
0answers
28 views

Hide (and show) Unity window using C#

I'm making a game (in Unity3d) that features a level editor. However, the editor is made in XAML (i use WPF on Windows Desktop). In Windows Phone, the Editor is a separate application, and i use URI ...
0
votes
0answers
24 views

how to pin down a sprite partly in unity?

I am working on a simple do not let the bombs hit the floor game for android. You control a stick which can rotate to left or right depending on where on the screen you touch (left or right). But I ...
0
votes
0answers
15 views

Unity Need Help With TouchControl

Just finished a simple game in windows,the commented out lines in Script works fine as intended in windows,however in android the controls felt bit wierd so modified the Script,but now the character ...
0
votes
0answers
52 views

crop a texture in unity

I am working on cropping a texture in unity. I have a button,when I click on the button,its takes the photo and the photo get saved to a folder in the phone. But when taking the picture I want to ...
0
votes
0answers
29 views

Unity AddExplosionForce to a Navmeshagent

the navmesh agent is intaracting with the exploding object, explosion occurs and agent takes damage but no pushback occurs. expodingobject using UnityEngine; using System.Collections; public ...
0
votes
0answers
15 views

Buttons duplicated on game scene

I have this set of buttons in a monobehaviour class: public GUISkin btnskin; public Texture2D emptyTex; public Texture2D fullTex; public Vector2 pos = new Vector2(20,40); public Vector2 size = new ...
0
votes
0answers
37 views

Face Detection in Vuforia Unity Android

I am working on face detection in unity.I have tried out a face tracking sample from the below link.It worked fine https://github.com/marcteys/unityFaceTracking The problem is that,when I runned the ...
0
votes
0answers
37 views

Unity Player Smooth Left - Right Movement

I am learning Unity 3d . Now I want to move the player object (The Ball) , Left and right by Left Arrow and Right Arrow key . I want smooth movement when the player goes left , but I don't know how to ...
0
votes
0answers
41 views

transform.Find() doesn't find the specified object

I am learning Unity and C# and I've hit a wall trying to use the transform.Find() function. I am following Brackeys' tutorial for 2D platformers (https://youtu.be/m-J5sCRipA0?t=10m53s) and using the ...
0
votes
0answers
45 views

Custom game loop entirely in the Update method

I am attempting to implement a custom game loop in XNA/Monogame. I know that one can re-implement the Game class using WinForms (with the caveat of having to also redo the content manager, etc.). I ...
0
votes
0answers
41 views

Apply Pixel Perfect by script in Unity?

How can I apply Pixel Perfect by script in Unity? All I could find on the web is this which does help at all..
0
votes
0answers
29 views

Turning a game into a server-client game

I'm redoing a game i wrote in XNA to Unity. The XNA game was the client to a server I wrote as a console application. How does Unity work with a server exactly, and how do you set that up?
0
votes
0answers
24 views

How to use OpenTK (OpenGL) with MonoGame?

So I've been making a snake game using MonoGame (DirectX Only). I added movement, controls, feeding and growing in length. I wanted to add smooth animations to the game because the snake is just made ...
0
votes
0answers
16 views

How to pass a java string variable from android activity to unity3d C# script variable?

Require some help to pass custom autogenerated text from android activity to unity3d activity being started.
0
votes
0answers
54 views

Update the Android Gallery after take a screenshot from android device using unity3d

Currently we are working on "Update the Android Gallery after take a screenshot Here follows our issues: The problem is that we are having a button,when we click on the button the photo gets saved in ...
0
votes
0answers
44 views

How can I record and play curves in Unity?

I need record and play curves for playback in My game. for example:I want always record xposition curve(for 50 frame) and when game over happen curves will load. public AnimationCurve ...
0
votes
0answers
30 views

How to create custom editor script only for one field of an object and leave the rest default in Unity?

I have a script attached to a game object. The script has many public fields and I'm satisfied with how Unity displays most of the fields for editing in the Editor. Except for a few. I'd like to write ...
0
votes
0answers
33 views

C# - XNA blurring tiles despite using PointClamp SamplerState

I´ve a problem drawing isometric tiles without getting pixel issues. The way I do it is the following: SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, ...
0
votes
0answers
29 views

How can I create a character for a 2D platformer in Farseer Physics 3.5?

I want to create a similar character like in this tutorial. http://www.madgamedev.com/post/2010/09/09/Article-XNA-Farseer-Platform-Physics-Tutorial.aspx But the tutorial doesn´t work for Farseer ...
0
votes
0answers
25 views

How do I set an array of matrices in HLSL?

I'm trying to render skinned meshes using Direct3D9 and HLSL. I am getting unexpected results due to the transforms that are bound to the shader. I am using PIX to view the constants and the values ...
0
votes
0answers
53 views

Drawing objects in view of camera only in XNA/MonoGame

I am working on a Tower defense style game on mobile that uses a tile map and I am trying to determine the best way to draw overlays of those tiles. In my game, I go into build mode to build towers. ...
0
votes
0answers
28 views

Problem with collision between two farseer bodies

I have four different bodies. Ground, rectangle, red ball, white ball. The rectangle and the ground are static. Just the balls are moving. The red ball can´t move through the rectangle, but the white ...
0
votes
0answers
197 views

Unity 3D - Changing emission color in realtime after export doesn't work

I am using the following code to change material's emission color in realtime: Color selectionColor = new Color(0.3f, 0.2f, 0.0f); void Start() { ...
0
votes
0answers
90 views

First person view camera control using joystick in Unity3D

Can anyone give me any tutorial about how to program a first person camera control using joystick in unity3d? I've been searching for this for a long time and I'm out of depth unfortunately. I only ...
0
votes
0answers
76 views

Unity 5 2d array for storing game objects and their data

I want to have a 2D array which has a number of rows relating to the number of game objects and 3 columns. I want each row to have the name of the game object and its position and velocity. Is this ...
0
votes
0answers
65 views

Unity C# event handler not triggered

I am trying out a system in my game in which I have 3 classes: EventService: MonoBehavior EventStore (a normal c# class) EventViewController: MonoBehavior EventStore registers some callbacks to ...
0
votes
0answers
66 views

How do I use Bezier Curves in unity?

I have to rotate few objects on an ellepsoidal(Capsule shaped) track and at the run time speeds are assigned to the objects from the server as this is a betting game which I am developing in Unity 5 ...
0
votes
0answers
60 views

State Machine help

I'm using a state machine for my enemy's AI. I've not worked with state machines before & followed Unity's live training on State Machines. I added a HitState to handle animation sequences. The ...
0
votes
0answers
55 views

How do I rotate an object on iTween path on a curved track in Unity 5?

I have 10 objects which I have to make run on an ellipsoidal track for which I am using iTween PutOnPath. The objects are running on the track but as the curved track comes the objects do not rotate ...
0
votes
0answers
40 views

How to change the Gameobject on a button click

Suppose I have a three gameobject(g1,g2,g3,g4,g5) and I have two button Next and previous.Suppose when i click on next button from g1 the object should move to g2,when i click on next button again it ...
0
votes
0answers
29 views

Is there a way to apply euphoria physics (ragdoll) to rigged Sprites in Unity2D?

With euphoria physics I mean the realistic object interaction and freefall as seen in most games like recent GTAs. But I want to do that in 2D. (I am a beginner :P).
0
votes
0answers
36 views

Evaluating ratings to balance weapons

I am developing a text-based battle arena RPG on the web. I'm at the part of development where I need to come up with weapons, and I want them to be balanced, yet I have no idea how to make a formula ...
0
votes
0answers
82 views

How do I change iTween values at runtime?

I am trying to figure out how to run and change the speed of rotation on an iTween path at runtime. I'm trying to code it in Unity5 in C#. I have to rotate a few objects on an iTween path which I have ...
0
votes
0answers
97 views

Snap gameObject to grid tile

I'm making a 2D TD game and currently I have made using quill18 tutorials a simple building system. However I'm trying to have it snap on my tiles as I mouse over them. This is my script applied to ...
0
votes
0answers
61 views

How do I Make an object run along with the the rectangular circle shaped path using iTween in unity 5?

Actually I have to rotate an object using iTween or usnig any other stuff if u know. Its like a betting game which I have to manage at run time. As I have been working on this game and have used ...
0
votes
0answers
17 views

How can I give rotation angle to an object running on iTween Unity5?

I have to rotate an object around a circular track which is a rectangular circle so for that I am using iTween and it is running perfect but the object does not change its own rotation just only runs ...
0
votes
0answers
60 views

LibNoise Perlin.GetValue not returning noise for zero decimal place numbers

I'm using the LibNoise port from C++ to C# and running into problems generating Perlin noise (Unity demo here). For some odd reason integers never generate any noise. In the code below _firstValue on ...
0
votes
0answers
17 views

How do I handle or manage commands which are sent by server in unity?

In my game there are 10 objects which are just started running on play as this is a web player game and betting as well and it requires some socket programming. At run time the commands are sent by ...
0
votes
0answers
80 views

Camera rotation in maze game depending of accelerometer

I'm still newbie in Unity 3D... I'm trying to develop simple maze game. I want to roll my ball through maze, but I have to rotate camera left or right, otherwise the player can't see what's behind ...
0
votes
0answers
143 views

Monogame and winforms - drag and drop images

So I managed to create the form design of my level editor and I embedded Monogame in it using the GraphicsDevice sample. Then I used the PrimitiveBatch sample to draw a black grid 32x32 pixels. Here's ...
0
votes
0answers
44 views

Use Lerp Position and Slerp Rotation together

This is what I try to do, When I click on a UI Element, the camera smoothly rotate (to look at the target) and simultaneously move on top of the target. To perform that I use a two Coroutine one for ...
0
votes
0answers
288 views

AssetBundle not working properly

I am using Unity 5.0.1. I have created the asset bundle of a sprite by selecting the name "img.unity3D" from the dropdown and then running the script : BuildPipeline.BuildAssetBundles ...
0
votes
0answers
59 views

Enlighten interfering with smartfox user objects

This code is checking if a userID matches any id in a SFSUser List: foreach(GameObject element in connectedPlayers){ if(element!=null) { ...
0
votes
0answers
32 views

Position is not what it should be when attaching fixture

In XNA / Farseer I have something like this: Body body = BodyFactory.CreateRectangle(world, 1f, 2f, 1f); FixtureFactory.AttachCircle(0.5f, 1f, body, new Vector2(0f, 1f)); I have been told that ...
0
votes
0answers
75 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
0answers
47 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
0answers
49 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 ...