C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
1
vote
0answers
14 views
How do I toggle color writes in SlimDX 11/Direct3D 11?
I'm having trouble setting the RenderTargetWriteMask field of a RenderTargetDescription struct. I simply want to toggle color writes but every time I try to enable the the color writes are changed ...
0
votes
0answers
16 views
Physics Object on Client moving too quickly in comparison to the Server: Should be a copy
I have a client server scenario. On the Server a force is applied to a 2d object. I want the client to copy the movements of the server but not through constant positional updates. My current approach ...
-1
votes
0answers
30 views
How to access a Steam Leaderboard using the Steamworks.NET C# Wrapper?
I'm using the Steamworks.NET C# Wrapper for Valve’s Steamworks API to enable Steamworks features within a Unity project. But there does not appear to be any documentation on Leaderboards for ...
0
votes
0answers
33 views
How to create a dynamic Map in Unity (Augmented Reality)
I created a dynamic map with a LineRenderer. The LineRenderer gets a new position assigned, for each movement my 'character' does. It works good, but I expect it to get a really bad performance at ...
0
votes
1answer
29 views
How do I lerp text color over time?
On my quest to understand Unity in a zero to hero sort of manner, I've run into a new problem I can't seem to really solve.
From computer science I know that updating GUI on the same thread as ...
0
votes
0answers
13 views
Saving issues Unity? [on hold]
I am testing this on an Android device and I cannot save the High Score locally properly. What's the problem with my code?
0
votes
0answers
23 views
How can I delete parts of a mesh in Unity?
I am trying to make a destructible game environment; I want to delete the vertices (and triangles assorted to them) within some sphere of a given radius with its center at the contact point (in ...
0
votes
1answer
23 views
How do I interpret the differences between the “Time” and “Self” columns in Unity's profiler?
I'm not quite understanding how to read the results of the profiler:
A method Pathfinding_NodeAdjuster.CheckSpecificArea() method is using up 94.7% of the BehaviorUpdate overall time, while taking ...
1
vote
2answers
96 views
Pausing the game
I've had a look around and kept finding about using Time.TimeScale = 0 to pause the game, although this is the normal way to do it, it is not exactly what im looking for.
When my menu button is ...
0
votes
0answers
36 views
Causing a rocket engine to 'cut out' (Scale down and re scale up)
In a game im currently working on I have a fuel bar for the player. What I am currently trying to do is have the fuel bar, at around 25%, cause the player engine to cut out a little to represent the ...
0
votes
0answers
16 views
Error with Instantiate? [on hold]
I'm getting error with this code:
var myNewSmoke = Instantiate (cube, temp, transform.rotation);
myNewSmoke.transform.parent = gameObject.transform;
error:
Type ...
0
votes
0answers
32 views
Absurd issue with Vector3.Distance [on hold]
I am encountering an extremely absurd phenomenon. When I run this code on my smartphone via Unity Remote or even on the computer, it works as expected. But when I install the APK on the device and run ...
-1
votes
1answer
43 views
Detect the position of the mouse press? [on hold]
I am encountering an extremely absurd phenomenon. When I run this code on my smartphone via Unity Remote or even on the computer, it works as expected. But when I install the APK on the device and run ...
0
votes
0answers
14 views
Preventing a NavMesh agent from moving Diagonally?
I'm currently working on a topdown game that uses 3D models. I am planning on using the NavMesh system in Unity to handle the movement of my NPCs, however, the NavMesh agents move diagonally when ...
0
votes
0answers
9 views
Unity5 3D Hex tilesets and map generator [on hold]
I want to challenge myself to make a prototype for a hex-based strategy game idea I had, but I am not so familiar with Unity or hexagons to be sure I have a decent plan.
The idea is to generate a ...
0
votes
2answers
58 views
Unable to move GameObject?
This simulates a GameObject swinging between two positions.
I am unable to manually move a GameObject on the Y axis using the Unity editor (in scene view) when the following script is attached and ...
1
vote
1answer
79 views
Designing a stats system
NOTE: I am currently not using any frameworks or other game dev tools like Unity - this is purely written using c# 6.0 in Visual Studio 2015. I would be interested to learn about any frameworks or ...
0
votes
0answers
24 views
Getting error with transform.position? [closed]
This simulates a GameObject swinging between two positions.
I'm getting this error when I run the code below:
error CS1502: The best overloaded method match for
...
3
votes
1answer
75 views
How do I “teleport” an object in Unity?
I'm trying to make a script where once a player triggers a collision they are teleported to another position that is determined by a empty game object. I think it has to do something with the ...
1
vote
0answers
20 views
Translate D3DXMatrixLookAtLH to Unity compatible code
I am currently trying to port a really old Game (I have the source of it) to Unity as a fun project. And I'm currently stuck with the object rotation techniques in Unity compared to the ones used in ...
0
votes
0answers
40 views
My Movement Function is working good but called only once
I have a function, It's working but not getting called every frame if It's in canMoveDown function but !canMoveDown its not.
if (!canMoveDown && UpdateTilePhysics(currentBoardPiece)) like ...
-3
votes
0answers
30 views
WPF for 2d game [closed]
I want to create the snake game in WPF, could you recommend what should I use for the graphics and animations ?
0
votes
0answers
22 views
Why does Intel Graphics Monitor crash after I set a depth stencil state in my Direct3D 11 application?
I'm programming a managed Direct3D 11 application with SlimDX. I want to use Intel Graphics Monitor to capture draw calls for a single frame. When I try to set a depth stencil state my application ...
0
votes
0answers
23 views
Create multiple object with for loop [closed]
Like in question, I want to create multiple object from the same prefab in for loop.
Something like this:
for(int i = 0; i < 4; i++)
{ GameObject Orb = (GameObject) Instantiate (OrbPrefab, ...
1
vote
1answer
50 views
Loading font in Monogame
This question is probably a duplicate but I'm still asking it since it's all yesterday that I'm trying to get this done without any success. I followed many solutions and tried even more libraries ...
0
votes
2answers
30 views
How can I implement Player Prefs to Save High scores in unity?
I am new to both unity and C# and facing trouble in saving and displaying the highscore.text in the game.Til now I only successfully managed to display the scoreUI and update them whenever player ...
0
votes
0answers
41 views
Mathf.PingPong Speed Issue?
How can we stop Mathf.PingPong speed from increasing once the object1 and object2 have reached a specific distance between each other?
float min;
float max;
// Update is called once per frame
void ...
1
vote
2answers
60 views
Player shooting himself when moving - Unity UNET
Setting : Creating my first multiplayer game and running into an odd issue. it's a tank game where players can shoot bullets and kill each other
Problem : When the client shoots while moving, the ...
0
votes
0answers
32 views
How to create a ghost mode to replace Human character 2D platformer
I am making a 2D platformer with a character that requires a player to go through a few obstacles to reach the finish line.
I want to make it so that after a few tries and obtaining a set of input ...
1
vote
2answers
68 views
Calculate Position on Tile Map by single Index
I stumble about a Math Problem for calculating a Position on a dynamic tile-map.
So i got a List of Tile Entities. Every Tile got his one unique Index Value and i have to set the parameters for Map ...
0
votes
2answers
86 views
How to fix my tile-based game's tile movement code ? (like a CandyCrush Style)
I'm currently creating a tile-based game like a CandyCrush style direction movement (no problem on only down movement) trying to smooth, not laggy tile movement with a board piece, and I'm writing a ...
0
votes
1answer
32 views
Setting a Boolean as a field of an object from another script
I saw this question asked some times but no one correlates to mine. I see people using the GetComponent() function but this one should work too.
First I receive a Bool value from a toggle button and ...
0
votes
1answer
57 views
Passing strings padded with white space into a byte[]
I am using Google Play services for a real time multiplayer game in Unity 3d. When sending the data in a byte[] in the multiplayer update I have to pad certain entries going into the byte[] with white ...
0
votes
0answers
32 views
Unity 5.3 Asynchronous Texture Upload in C#
I want to load textures asynchronous in C#. I heard it that it is possible to do it in Unity 5.3. However documentation doesn't mention how to do it in C#. Does anyone have an idea how it works?
...
1
vote
1answer
82 views
Initializing Consumable product to an amount on first use
I am using Unity's In App Purchase plugin to implement an in game store. In my game every player has fuel. I'd like to use the plugin in order to keep track of the amount of fuel the player has so ...
0
votes
0answers
16 views
Move car with script [duplicate]
How would I go about writing a car script in C#. Is there anything special I would need to code. Or is it simply if pressed certain button, Rigidbody.AddForce() or transform.Translate().
My question ...
0
votes
3answers
39 views
Creating a toggle button in unity3d Scene vs Scripting
I am making my first GUI in unity, and I am not sure if should create the toggle buttons in the game scene by creating new UI elements or by scripting.
Creating them in the game scene gives me more ...
0
votes
0answers
18 views
Removing the little box from a toggle button
Hello everyone I've this toggle button:
public Texture2D togglebutton;
hydro.t1Bool = GUI.Toggle (new Rect (25, 155, 100, 50), hydro.t1Bool, togglebutton);
everything is fine, in my scene I added ...
0
votes
1answer
42 views
SceneManager.GetActiveScene(); return -1 when Debugging active scene in editor
I'm trying to use the new SceneManagement since Application.LoadLevel is obscelete and I've read that we need to put it like this.
using UnityEngine;
using System.Collections;
using ...
0
votes
1answer
21 views
How to find the participation id corresponding to a sender id
I am creating a real time multiplayer game in unity 3d using Google Play Game Services. In my function where I deal with the positioning of players based on information that is sent from other ...
0
votes
0answers
59 views
Unity3D freezes when running a project with webservices for the second time
This is a strange one and I've been trying and searching for a solution for days now.
I have created a simple webservice that queries a local MYSQL database and returns the result for the client. ...
-1
votes
0answers
73 views
How to align one GameObject to another without penetrating in a “sticky” collision? [duplicate]
This script makes a cube "stick" to whatever it collided with. The problem is that when it's going at relatively high or medium speeds (or when the device itself is slow), the cube tends to "get a bit ...
0
votes
3answers
95 views
Move Camera When Player Move C#
i developing side Scrolling endless Game. i want to Change X Axis of camera as player moving to Right. and i almost Done That. but the problem is when move Camera to the Right then its look so stiff ...
0
votes
0answers
28 views
Undesired Rotation Produced by Mouse [duplicate]
I have the following C# script for my gameobject:-
mousey = Input.GetAxis ("Mouse Y") * sensitivity * Time.deltaTime;
mousex = Input.GetAxis ("Mouse X") * sensitivity * Time.deltaTime;
...
0
votes
1answer
39 views
Access buttons individually made by a for loop (old Unity GUI, Unity Editor script)
I've got a problem and I am struggling with this for a couple of days now.
I am making an Editor script and I want to access buttons individually when
created by a for loop. There is a public class ...
0
votes
2answers
59 views
Pass Vector2 to Instantiated GameObject
I am trying to get an AI sprite to randomly shoot a SINGLE bullet while walking around. This is a 2D Top-down perspective. The sprite can move up, down, left and right. It randomly changes directions.
...
3
votes
1answer
62 views
Is it Possible to play Musics / Songs stored in the mobile to play inside the game?
hi I am creating a car game, I just like to know is there is any way to play the musics Stored in our phone to play inside a game?
If the player select MP3 player the songs stored in the mobile wants ...
0
votes
3answers
63 views
Trying to get two variables to stay in sync between 2 scripts. Anyone know what the issue is?
Basically I am making an inventory system where the player has a set amount of objects, and if they go to a pickup then it will give them more of that particular type of object. I have two problems ...
0
votes
1answer
28 views
Script for non-stop enabling/disabling “Is trigger” on collliders2d in Unity3D?
I had asked before that I have a problem with too many colliders in one spot and that some upgrades of towers I have are buggy due to that.
It has come to my notice, that whenever I enable the "Is ...
3
votes
1answer
46 views
How would I create a billboard that is fixed to my camera's farplane?
I'm currently trying to set a GameObject(plane) to be positioned at my camera's farplane. I plan on using this billboard as a sort of dynamic skybox. Any help would be much appreciated.