hi, i'm quokka 🎧
i make games, mostly small, colourful and a little silly.
this is where i share work in progress, happy accidents and what i learn along the way.
nice to meet you ☀️
GetComponent<T>() ?? AddComponent<T>() never added anything, and the next line threw.
Unity's == knows a destroyed or missing object is "fake null". ?? and ?. only run C#'s plain null check, so they treat it as there.
TryGetComponent, or == null.
#unity3d#csharp
a sightline check printed clearance = Infinity and passed. it had tested 0 triangles 🧪
in Play Mode, a mesh with Read/Write off logs an error and returns no vertices, so the loop never ran.
check mesh.isReadable, and make "could not measure" a failure.
#unity3d
the ladder passed every test, then failed when a test walked into it 🪜
a CharacterController keeps a skin gap: pushed into a wall it rests up to skinWidth past its radius. a range check of exactly the radius misses that pose.
measure the rest, add a margin.
#unity3d
in a blender script, a child's matrix_world can still hold the old value right after you set its parent 🐍
world matrices refresh when the dependency graph updates. call bpy.context.view_layer.update() before you read it.
#blender#gamedev
in the editor, screenshots came back with flat cyan patches where objects should be 📸
that's Unity's placeholder for a shader variant still compiling. render with async compilation off (ShaderUtil.allowAsyncCompilation = false), then restore the old value.
#unity3d#gamedev
white specks on deep water, nowhere near the shore. the foam mask there was exactly 0 ✨
step(noise, mask) returns 1 whenever mask >= noise, so any pixel whose noise is also exactly 0 still passes.
gate it: mask > 0 ? step(noise, mask) : 0
#shaders#gamedev