Tag: C#
All the articles with the tag "C#".
The Page Says 2023, and What You Get Is the 2020 LTS Edition
A landing page clipped while studying optimization, after it occurred to me that using high-quality models might make the game unplayable on a low-spec PC. The page is dated October 19, 2023, but the cover of the PDF behind Read now says '2020 LTS edition'. I picked four sections to see where that gap shows in the body.
Some Functions Read z as a Distance and Others Throw It Away
Code I clipped while trying to hide the cursor at the center of the screen in an FPS and raycast from that point to find where a shot lands. The original calls z a 'fix that puts the axis in camera terms'; the docs call it 'the distance of the resulting plane from the camera'. It's not a fix, it's a choice — and locking the cursor removes the need to read the value at all.
What Decides the Point to Look At Is the Plane, Not the Ray
Short code for facing the mouse, clipped while looking for how to do top-down controls. The method is right, but the plane sits at the origin and the height gets patched in separately. Put the plane at the object's position and that patch disappears.
What You Can Stop Is Only 'the Currently Set Clip'
Clipped while looking for how to play a video's separately extracted audio just once, then pulled back out while working on in-game dialogue and SFX output for the TTS project. It lays out the difference between Play() and PlayOneShot() in two paragraphs.