Questions tagged [c#]

C# is a multi-paradigm, managed, strongly typed, garbage-collected, programming language created by Microsoft in conjunction with the .NET platform.

1,325 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10 votes
1 answer
2k views

How can I Implement spin in billiard game?

I'm not sure that you played billiard or snooker before.if you played you should know about spin. but anyway if you don't know about it you can see it in this video I want to Implement spin like this ...
Seyed Morteza Kamali's user avatar
8 votes
0 answers
1k views

How do I make volumetric grass?

I've been extremely interested in volumetric technology, especially for grass. Online resources are extremely scarce on this topic. What is the difference from creating a lot of mesh billboards? ...
Scavs's user avatar
  • 193
8 votes
2 answers
2k views

NegaScout with Zobrist Transposition Tables in Chess

I'm trying to put Transposition tables into my alpha beta scout. I do see an incremental speed boost I think toward mid or late game, however, even with a table size of 1-2GB, its may or may not be ...
missCache's user avatar
7 votes
1 answer
2k views

Unity 5.3.5 - How to setup a lobby with general game settings?

I am currently working on the lobby for my game. I have followed these tutorials (https://www.youtube.com/watch?v=jklWlm5v21k), which were very helpful, and was able to setup my lobby like this. The ...
Jasper's user avatar
  • 133
6 votes
0 answers
677 views

Procedurally generated paths with intersections

The Problem I've been attempting to create some procedurally generated paths for a while now, but I've reached a problem when it comes to generating the intersections of the paths. The paths are ...
Daniel Holst's user avatar
6 votes
2 answers
559 views

Collision detection problem in XNA4/Monogame

I have been trying to get 3D collision detection working for a while and I think (hope) you people can help me. For my project I have created a 'sprite3d' kinda class which is called ...
bobythebob's user avatar
4 votes
0 answers
271 views

Unity3d: calling a web service in unity editor works, but not in standalone. Why?

I have this line of code: SDE3D _webService = new SDE3D(); int result = _webService.UserLogin(txtLoginUsername.text, hashString); My ...
stighy's user avatar
  • 887
4 votes
0 answers
533 views

Why am I getting errors like these when trying to build my app

I am currently trying to build and publish my app to the universal windows platform halfway through the process of doing so, during the validation process I got stopped with these errors. The 1st one ...
Jayson Meribe's user avatar
4 votes
0 answers
152 views

Monogame resizing GraphicsDeviceControl in WindowsForms?

I'm currently working on a custom Map editor using Windows Forms. I have a class inheriting from GraphicsDeviceControl (called MapDisplay) that I'm using so that I may use spritebatch to draw the ...
Swarles's user avatar
  • 41
4 votes
0 answers
1k views

Are there performance benefits to using WaitForSeconds vs checking elapsed time in FixedUpdate in Unity?

I was considering that perhaps just checking the time and then doing some work in the Update function might look cleaner than calculating how long to wait for and calling yield new WaitForSeconds() on ...
James Joshua Street's user avatar
4 votes
0 answers
661 views

Rendering hundreds of animated characters in Unity3D

I am currently doing some research in anticipation of the development of a game where there are going to be hundreds of secondary entities which will interact with the player and among themselves (...
Marc Jacob's user avatar
4 votes
1 answer
223 views

Set input relative to map rotation?

I'm trying to figure out how I can make the input which looks like this : ...
BiiX's user avatar
  • 489
4 votes
0 answers
3k views

Procedural Islands Voronoi Pattern

I'm trying to keep this as simple as possible, as I've found out the last few days this is a very difficult topic. I'd like to generate multiple flat islands, formed by a voronoi diagram. I've ...
user2255273's user avatar
4 votes
0 answers
67 views

Why does interactive cloth not appear in game view in unity5 Pro?

I used interactive cloth fir flags in unity5 Pro version and it appears in scene view but does not appear in game view while playing. What can I do for that please somebody help me out?
Shraddha Patel's user avatar
4 votes
1 answer
2k views

How to code a non-newtonian spaceship control script?

I'm working on a simple 3D space combat game, and I've decided to go with simplified physics over proper newtonian motion, similar to the space sim Oolite, and more 'arcade' style games. I basically ...
moran's user avatar
  • 157
4 votes
1 answer
4k views

CPU Usage and Available Ram in Unity 5

In Unity 5 I would like to be able to print out the CPU Usage and Available Ram left in MB. I followed the code posted on http://zamov.online.fr/EXHTML/CSharp/CSharp_927308.html and used it, however ...
CH99's user avatar
  • 563
4 votes
1 answer
3k views

How to implement a professional fighting game input buffer?

Ok guys, I understand how to make a basic input buffer. Here is my code: ...
Cristian Ceron's user avatar
4 votes
1 answer
1k views

XNA Webcam video

How can I embed a video in a XNA application? I'm developing a card game with XNA C# and I need to send webcam video between four machines. Could anyone give me some tips about that?
Luis's user avatar
  • 303
3 votes
0 answers
41 views

How can I create good looking sprite color stretching metaballs?

It has been 8 months I've been working on my metaball algorithm an the final technique I am trying out is writing magnets to which the sprite mesh edge vertices will update its position to, after ...
rasputin's user avatar
3 votes
0 answers
518 views

How to validate an Exception occurred as expected in a Unity Test?

I am trying to write unit tests in Unity that assert that logs, errors, and exceptions are raised as expected in my code, but I'm getting inconsistent results. I'm using ...
Just_Alex's user avatar
  • 131
3 votes
0 answers
462 views

Generate a 2D field-of-view cone

I have a bunch of randomly generated boids flying around on my screen, but I want a function that can give them a field-of-view where they can "see" other boids or obstacles. The code I ...
Elstadt's user avatar
  • 31
3 votes
1 answer
47 views

Spritebatch drawing the other way

I am drawing a rectangle using a emptytexture (1x1) and I use the following: ...
Alanus Ger's user avatar
3 votes
0 answers
172 views

Why isn't my method an option for onClick?

Update: The problem went away when I restarted Unity and tried again. The problem I am using Unity 2019.1.8f1 Personal with Visual Studio for Mac 7.8.4. I have a button named ...
Ellen Spertus's user avatar
3 votes
0 answers
322 views

Limit mouse movement within 2 points

I have a circle sprite that i only want to move between 2 empty game objects (points). Using Vector3.Lerp() I'm able to move the circle between those points ...
SenaCarbtc's user avatar
3 votes
0 answers
144 views

How to create a tube 2D in unity

I want to create a 2D tube in unity which I can cut, suture and drag it, My idea is to use a small image in form of fragments but how i can do it like the picture bellow EDIT : What I did until ...
Amine Choukri's user avatar
3 votes
0 answers
418 views

What is causing a SIGSEGV in mono_class_vtable_full in Unity for Android?

I'm a developer of a mobile game, and we have Crashlytics in our game. For the latest release for Android, we are having crash reports with the following stack trace, for a number of players: ...
Paiman Roointan's user avatar
3 votes
1 answer
562 views

Create context menu in Scene view

I created some MenuItemfunctions for navigating, which are currently displayed on the menu toolbar. The C# code: ...
Elgirhath's user avatar
  • 209
3 votes
0 answers
310 views

Quest UI Display in Unity 2D

I have this quest manager script where I store all my quests for easy duplication. I'm adding a feature that gives the player the option to see his/her current to-do quest. The first thing I ...
Nicole James Cresencio's user avatar
3 votes
0 answers
49 views

Sprites being skipped over in simple sprite change script

Each instance of the prefab in question has a copy of this script on it, but they seem to be interfering with each other in some way. I would forego prefabs, except the final game I'm prototyping for ...
Ossie Halvorson's user avatar
3 votes
0 answers
416 views

Viewport not matching Window size when fullscreen

I am using: GraphicsDevice.Viewport.Bounds to determine the size of the canvas / stage for my window. This works well if I am in Windowed mode, but if I launched ...
mikechambers's user avatar
3 votes
0 answers
508 views

Pre-Hash Input Strings in Unity

So with the new Animator system, Unity has smartly allowed us to pre-hash the strings for looking up variables within the Animator state machine, using the Animator.StringToHash static method. This ...
Ecksters's user avatar
  • 131
3 votes
0 answers
144 views

How can I move the Player around the space station using the doors as waypoints?

The doors open automatic when the player is getting close to them and then close when the player get some far distance from them. Each door is built from door_right and door_left and I made that each ...
Benzi Avrumi's user avatar
3 votes
0 answers
63 views

Why the variable height value is all the time 0?

...
Benzi Avrumi's user avatar
3 votes
0 answers
445 views

Fog of War in Unity

I know that my question will not fall into the type of questions normally asked here (no coding presented). I just need some tips and advise on how to proceed (e.g. pipeline or something). I'm making ...
JDoeBloke's user avatar
  • 143
3 votes
2 answers
855 views

Efficient 2D grid overlay on tiles without each cell being its own GameObject

So for my game I need the ability to add a grid overlay over my tilemap. Now I don't think that making the grid with each cell being its own GameObject with some SpriteRenderer would be hard to do but ...
G3tinmybelly's user avatar
3 votes
0 answers
1k views

Unity2D: Proper way to implement ladder climbing with a raycast controller?

I originally posted this on Stack Overflow, but was told I might have more luck here: I've been slowing grinding out programming features for my character controller, and one of the last things to ...
Ginger and Lavender's user avatar
3 votes
0 answers
818 views

Find Max Line Count for Unity UI.Text

I'm trying to determine the max line count of a UI.Text with VerticalOverflow set to truncate...
BadmintonCat's user avatar
3 votes
0 answers
103 views

How would one get the pixel value of a texture under the cursor?

I have a requirement to detect which pixel of a texture is under the cursor in the 3D world. I assume that Ray casting is involved however, after that I'm not sure how one would accomplish this. Can ...
Reaper's user avatar
  • 153
3 votes
0 answers
1k views

How can i instantiate empty gameobject to be position to existing already gameobject?

When i click on keyboards for example dfrg i want that if i click on space it will add empty gameobject right after the letter g like a space for example: drg hello So there is a space after the ...
Oleg's user avatar
  • 31
3 votes
0 answers
689 views

Making generic type T method as a layer of abstraction for Unty3D's EditorGUI field draw methods

I am making a visual tool for Editor Window on Unity3D, and I am just recently using System.Reflection methods to get class's assembly data, to get information about properties, fields and methods (...
LifGwaethrakindo's user avatar
3 votes
0 answers
165 views

Design pattern for world objects caching

I'm developing in Unity a voxel-generated terrain and I'm trying to find an extensible design pattern for voxels and more in general, world objects caching. E.g. storing in a 'ChunkCache' class only ...
Row Rebel's user avatar
3 votes
0 answers
2k views

Simple 2D Fish Obstacle Avoidance

I am currently working on a simple obstacle avoidance system in unity. I have a player and a school of Ai fish that are traveling in a fixed direction (Down-Right). While swimming, I want the Ai fish ...
Charles Cox's user avatar
3 votes
1 answer
598 views

Start Broadcast Unity Network Discovery

I am using the unity NetworkDiscovery component, and I am wondering how I can auto-start broadcasting when the server starts, instead of the client having to click ...
zoecarver's user avatar
  • 131
3 votes
0 answers
289 views

Android game crashes when attempting to start wifi hotspots

I have two methods that will try to start the WiFi hotspot on the android device so that others can connect and play the game.the problem is both method have problems and don't work. the first method: ...
Henjin's user avatar
  • 405
3 votes
0 answers
118 views

Stop Mesh render on intersect

I am generating camera frustum mesh through code, it is working fine. Now I am searching a solution (shader based or else) to restrict the camera frustum mesh if it intersect with any object. Like you ...
Muhammad Faizan Khan's user avatar
3 votes
0 answers
400 views

Flow effect to static water on a isometric city

Hello everyone I want to give the idea that the river in my city is flowing but I am having an hard time to figure how. Do you have any idea of what I should look into to?
Grow Animation's user avatar
3 votes
0 answers
125 views

How to disable and enable a randomly generated prefab in an endless runner 3d

Hi all I have been experimenting the endless runner game for some time and needed to optimize it. I read some articles about optimizing my game and it says that once you instantiate the prefabs in the ...
Ashane Alvis's user avatar
3 votes
0 answers
305 views

UNET Performance of (many) Kinematic Rigidbodies

I am building a game in Unity in C# using the UNET networking elements. I am trying to figure out what is the performance cost of kinematic rigidbodies? My understanding is that, when kinematic, ...
ZCaceres's user avatar
3 votes
0 answers
541 views

Polygon 2D collision response- How do I find the correct edge a polygon hit?

Hey guys I've been seriously stressed out by this, so please go easy on me. My goal is to reflect a bullet (polygon) off of another polygon, and find the edge the another polygon, A (the bullet), hit....
Eric's user avatar
  • 783
3 votes
3 answers
358 views

Animation clip not working

I am working on playing different animation of key press.Below are the animation element attached to my player Initially run animation is played.I have written code to play "Jump" animation on ...
user1509674's user avatar

1
2 3 4 5
27