New answers tagged

3

Invoke is useful if you want to do something one time only. A coroutine is able to pause, let the game continue running, and then do something else later. This makes them useful for processes which run over time. Also, you can pass arguments to a coroutine. The Invoke method does not allow that. Example of a coroutine which implements a countdown: ...


0

It looks like the most notably absent elements in your engine render are shadows and ambient occlusion. I am not familiar with babylon.js but found these doc pages that will hopefully help you get closer to matching the Mental Ray output. https://doc.babylonjs.com/babylon101/shadows https://doc.babylonjs.com/how_to/using_the_ssao_rendering_pipeline


3

There are multiple approaches how you can achieve a good placement snapping. I personally don't know Fortnite enough to be able to tell you what approach they are using. I would guess it's some kind of snapping points and a clever decission algorithm on which point to take. Here's a list with some snapping techniques that I know of. This list is not a ...


1

You can't mix immediate mode (glBegin, glEnd, etc.) with the programmable pipeline (shaders) like this. You either need to stick to immediate mode (you really shouldn't, it's 2019) and use shaders that are compatible with it (using the built-in variables instead of attributes) or use a modern OpenGL version and pass the model information as vertex buffer ...


0

If the player won't be able to ever see it as a sphere (eg. by going to high altitude), you can fake it. Make 'normal' voxel world, but wrap it at the borders. Trying to load chunk [-1, 5]? Return [MAX_CHUNK, 5]. Want to visit [MAX_CHUNK+1, 5]? Oh, you mean [0, 5]. This way you won't get nice "hills rising from above the horizon as you get closer" effect, ...


2

If I were doing a 3D game, I'd not go into physical simulation of birds but rather a simplified kinematic trajectory model of a flying thing. The trajectory of a bird in flight is simply three accelerations and three orientations. Once you determine (at runtime) the accelerations of the bird (or the trajectory of the bird), you add corresponding animation ...


0

Advice I give to Unity developers is please never look up or compare GameObjects by name. It's a very brittle way to work and we have better options available to us. In this case, your cube objects are not named "cube" or "Cube". They're named "Cube(Clone)" as we can see in your screenshot, so comparing the name to "cube" returns false and you always skip ...


0

When you instantiate an object then the name of the object will be "Object Name+(Clone)" for example in your case the object name you want to instantiate is "cube" but after the instantiation the name will be "cube(Clone)" so you have to compare with "cube(Clone)" instead of "cube". void OnTriggerEnter(Collider other) { if (other.gameObject.name == "...


1

What troubles me is you're not using quaternions for an Arcball camera. My answer comes from some of my DirectX code so if you see some strange behavior, I probably messed it up for OpenGL ;) it is far more simple to use quaternions, even if that sounds barbarian to you, it is easier to wrap ones mind around quaternions than matrices (of course in the ...


Top 50 recent answers are included