Categories

## Unity – How do you load a material from a .mat file at runtime (say downloaded from WWW)

Unity – How do you load a material from a .mat file at runtime (say downloaded from WWW)

Categories

## Understanding ambient lightning

I’m currently learning how to use OpenGl, and I’m following a tutorial on learnOpenGL. I’m at the lightning chapter, and it has introduced basic lightning, ambient and diffuse with specular highlight. Phong shading essentially. I’m confused about the ambient term. I understand that the ambient light is basically a light that comes from nowhere in […]

Categories

## What is an efficient way to get a look-at direction from either a quaternion or a transformation matrix?

So, I have an object in my custom engine (C++), with a column-major transform in world space. I’m using a package that takes a look-at direction as an input. What’s the most efficient way to get a look-at direction from this transform? Do I extract the rotation matrix? Do I try to extract a quaternion?

Categories

## Looking for a market price algorithm for a turn based game

I am new at game development and am now facing the problem for a market price algorithm in a turn based game. What I try to achieve: the market starts with fixed bidding and asking prices for one piece of goods. To keep it simple the minimum value is 1, the maximum 20 if the […]

Categories

## Player can only dash towards to the top right, but can’t in any other direction?

I have a dash mechanic, but it only seems to be working when the player is going up, down, left, right, or to diagonally to the upper right. It won’t work diagonally in any other directions, and I can’t figure out why? The super weird thing is this problem only happens when my game is […]

Categories

## How to share constant variables between Compute Shaders?

So, I have two compute shaders A and B (using unity and HLSL). Right now, before every dispatch, I send my mouse coordinates to both of them every update. So, from my understanding, you can actually determine which register the mouse coordinates go to like so: float2 mxy :register(c1); // at the top of the […]

Categories

## How can I create Lists of 10 items out of 1000 items array?

void Start() { pos = GetLinePointsInWorldSpace(); var partsofline = new List<List<Vector3>>(); int count = 0; List<Vector3> poss = new List<Vector3>(); for (int i = 0; i < pos.Length; i++) { if (count == 9) { count = 0; partsofline.Add(poss); } poss.Add(pos[count]); count++; } pos is array of Vector[] pos contains 1000 items. I want to […]

Categories

## Will my game be banned on steam if I added ISIS army to the game?

I’m making an fps game in unity to be published on steam, and I want to add ISIS army as the enemy, but the player could also choose ISIS as his team in Custom battle mode (basically in custom battle mode the player could choose any team and customize things freely). So I’m wondering, could […]

Categories

## How to adjust a path to avoid collisions with moving obstacles inside a nav mesh?

I’m writing a script for a bot and I’m a little bit stuck. There’s a game, there’s a player (me) and I want to get from point A to point B. I can find the path via bot’s API (it returns a List<Vector3F> points). There’s also an NPC who wanders along a known route (also […]

Categories

## 2D/3D Soft body physics in Unity

I want to implement soft bodies in my game similar to this link. I tried using this Soft body simulation plugin but it has the following problems: Only works with box colliders. Doesn’t work with Unity’s physics engine i.e. the bodies don’t react to the forces applied. For my game, The soft bodies should be […]