New answers tagged

0

Without using a physics library, collision check works the old way: collision masks. These are binary images, which GMS uses to perform collision checks between two instances at a time. If they overlap (i.e. if pixels from both images align), then a collision occurs. Since this approach is pixel-based, there are no vectors to work with, and we cannot define ...


0

Using orthogonal distance to/from the cube edge as input parameter t, you may want to linearly interpolate your character's local euler angle around a single axis, or else spherically interpolate your character's rotation. That is, your final rotation will be smoothly interpolated between 0.0 and 1.0 of the rotation between your first plane's angle and your ...


1

The code I was trying to use looked like: NativeArray<RaycastCommand> commands; <code to initialize commands> <loop through the commands> commands[currentIndex].from = transform.position; commands[currentIndex].direction = dir; And the error was: error CS1612: Cannot modify the return value of 'NativeArray.this[int]' because it ...


1

It looks like you meant to write something like this: void Update () { if (Input.GetMouseButtonDown(0)) { var mousePosition = Input.mousePosition; mousePosition.z = 10f; var facing = Camera.main.ScreenToWorldPoint(mousePosition)- transform.position; facing.z = 0f; // Get a position a fixed distance in the mouse ...


0

As posted on threejs.org forums: var intersects = raycaster.intersectObjects( group.children); Try it like so: var intersects = raycaster.intersectObjects( group.children, true ); The second parameter indicates you want to test all descendants of group.children.


Top 50 recent answers are included