New answers tagged

0

I know, it's a bit late but try boundingSphere.Center += entityPosition; before you return your sphere in CreateBoundingSphereForModel


0

It could be Constructive Solid Geometry indeed. But they said in the store page it is a voxel-based world (unless they lied of course). Which is basically pixels in 3D (or i could say cubes in the case of minecraft, and others). In this case, it seems to me they smooth out those voxels to achieve that organic looks. Something like Castle Story which you can ...


1

I'm not currently at my computer to show a valid demonstration, however, I've used "Camera.main.ScreenPointToRay(Input.mousePosition)" casting that ray and referencing the point that it hits. You could set that point to be the position that your character looks at via Vector3.lookToward(). Also,you are correct, this would work regardless of camera angle as ...


0

Removing the player prefab and re-adding it did the trick When I added the player again, the 'player' avatar was automatically assigned to it. I did not have to do it manually. And this 'magically' solved the issue somehow.


1

I'd like to point you to the work of J. van de Berg et al. on Optimal Reciprocal Collision Avoidance. http://gamma.cs.unc.edu/ORCA/ In their paper, they provide the mathematics and algorithm outline on how to solve the problem you state in an optimal way using randomized linear programming. Best of luck :).


1

I can think of two reasons: if your quats represent infinitesimal rotations, adding them together actually yields the composite rotation, provided the result is infinitesimal too (i.e. an element of that algebraic group). Quaternion addition, as opposed to multiplication, is commutative and, well, numerically fast. One situation where this might be "a ...


1

I don't think there's an efficient way of solving the problem exactly, but here's how I'd try to tackle it. First, I'd use bounding volumes around each object, instead of the objects themselves. Each object can be approximated by the union of more than one bounding volume, though. The simplest solution would be to compute a single bounding volume that ...


0

There are two ways to address this question that I can see. First, if you simply want to find a way to steer, then you just need to implement pathfinding (I find this quite helpful). That would be the end of that (and is the correct practical answer to this question), but I think you are more curious about a mathematical solution to your problem. To address ...


2

When you have 2d sprites in a 3d environment, they work like two-dimensional planes. Think of them as cardboard-cutouts which are moving through the world. When you want to rotate these cardboard cutouts to always face the camera, then the search term you are looking for is "Billboarding". It can be implemented by attaching this MonoBehaviour to it: using ...


1

I would recommend you to place the 2d sprite not in the game world but instead place it on a UI canvas with "Screen Space - Overlay" mode. You can convert the game-world position of a GameObject to screen-coordinates using Camera.WorldToScreenPoint. Then you need to convert the screen coordinates to canvas coordinates and place your sprite there. Code ...



Top 50 recent answers are included