New answers tagged

0

Simply set the inverse inertia tensor to all zeros. The simple explanation here is that the inertia tensor of an object describes how that object resists rotation when acted upon by outside forces. A zero inverse inertia tensor implies that the object has infinite inertia in all directions, and thus resists all rotation produced by physics. https://github....


0

The problem is that the velocity.Y when the gravity is reversed , keeps increasing to the infinity. That's what your code tells it to do: velocity.y += gravityScale * globalGravity * Time.deltaTime; Perhaps you are forgetting to check if the gravity is negative or positive when determining whether the object is falling. Here's what you probably want: if (...


1

I believe what you're looking for is what I refer to as "Google Maps" style panning. This is where the pointer stays perfectly locked on the exact place in the world where you started the pan. Like @DMGregory mentioned, you need to do everything in world space. You start by caching the pointer's position in world space when the drag begins. Then ...


0

Your moveDistance is measured in screen pixels. If you want to convert that to a world space unit, you need a function a bit like this: float ScreenToWorldDistance(float screenDistance, Camera camera, float depth) { float visibleHeightAtDepth; if (camera.orthographic) { visibleHeightAtDepth = 2f * camera.orthographicSize; } else { ...


2

public enum CubeFace { Left, Bottom, Back, Right, Top, Front } public static GetFaceToward(Transform cube, Vector3 observerPosition) { var toObserver = cube.InverseTransformPoint(observerPosition); var absolute = new Vector3( Mathf.Abs(toObserver.x), Mathf.Abs(toObserver.y), ...


1

I found an answer in the Unity forums, which is: no it's not possible, at least not in Unity 2019. One thing you could do is force the bounds to be larger by adding 2 particles, one in each corner at a very large value. To do this, you can call Emit on your system to generate a particle with an infinite lifetime at an extreme position. For example, emit one ...


Top 50 recent answers are included