game-physics

Physics object doesn't bounce correctly at low speed in Unity

大憨熊 提交于 2020-04-16 02:04:33
问题 I am running into a problem where when a physics enabled ball is going slowly it doesn't bounce off objects correctly. I have made a video to illustrate the problem https://youtu.be/9T1hkir7sCo Basically, the ball should run into the stationary ball and the stationary one should bounce off. This works when the speed is fast enough, but below a threshold they both just start moving together, which looks weird. Whats going with this, and how can I make it react properly? Experiment details

Swift: No contact detection between nodes

♀尐吖头ヾ 提交于 2020-03-23 08:03:14
问题 Issue This is my code for my game. A brick falls and hits a side of a square. To differentiate what side is hit, four triangles are spawned that make the square. They are invisible from a low opacity. I am not receiving any contact between the brick node and the triangle node. The brick piece just falls right through the square. Any help? Game Code import SpriteKit class GameScene: SKScene { let basicTop = SKSpriteNode(imageNamed: "basic top"); let basicBottom = SKSpriteNode(imageNamed:

Swift: No contact detection between nodes

徘徊边缘 提交于 2020-03-23 08:03:10
问题 Issue This is my code for my game. A brick falls and hits a side of a square. To differentiate what side is hit, four triangles are spawned that make the square. They are invisible from a low opacity. I am not receiving any contact between the brick node and the triangle node. The brick piece just falls right through the square. Any help? Game Code import SpriteKit class GameScene: SKScene { let basicTop = SKSpriteNode(imageNamed: "basic top"); let basicBottom = SKSpriteNode(imageNamed:

Bouncing ball code causes jitter in HTML5 canvas

…衆ロ難τιáo~ 提交于 2020-03-05 04:39:33
问题 I have a HTML Canvas on my website that I use to contain balls that drop into the canvas, they bounce around and have a real good time settling down at the bottom in a range of ways. I was under the impression this was working perfectly. However, it has now been brought to my attention these balls jitter and freak out on other people's computers. I checked the browser they are using and it is the same as mine (Chrome V79). So just to clarify - I have never had it bug on my computer but it

Bouncing ball code causes jitter in HTML5 canvas

本小妞迷上赌 提交于 2020-03-05 04:37:28
问题 I have a HTML Canvas on my website that I use to contain balls that drop into the canvas, they bounce around and have a real good time settling down at the bottom in a range of ways. I was under the impression this was working perfectly. However, it has now been brought to my attention these balls jitter and freak out on other people's computers. I checked the browser they are using and it is the same as mine (Chrome V79). So just to clarify - I have never had it bug on my computer but it

Connecting a maze/grid's walls so all are interconnected

霸气de小男生 提交于 2020-03-01 10:20:27
问题 I have a 2d grid that I'm trying to create links between all walls. The grid is constructed like so: grid = new State[8][8]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { grid[i][j] = State.blank; } } I have a robot that should be able to pass through the walls to the opposite side like on a game of snake. So for example if the robot is facing NORTH and is in position x[0]y[1] then it should connect to x[7]y[1]. The robot should also be able to read whats in the three blocks in

Connecting a maze/grid's walls so all are interconnected

吃可爱长大的小学妹 提交于 2020-03-01 10:20:12
问题 I have a 2d grid that I'm trying to create links between all walls. The grid is constructed like so: grid = new State[8][8]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { grid[i][j] = State.blank; } } I have a robot that should be able to pass through the walls to the opposite side like on a game of snake. So for example if the robot is facing NORTH and is in position x[0]y[1] then it should connect to x[7]y[1]. The robot should also be able to read whats in the three blocks in

How to handle multiple simultaneous elastic collisions?

一曲冷凌霜 提交于 2020-02-26 10:05:09
问题 I'm computing the result by colliding pairs of 2D convex objects (without rotation), using the basic equations on wikipedia. However, when there are dependencies, like two objects hitting another object at the same time: Such as here, with objects 1 and 2 hitting 3 at the exact same time, the pair-wise approach fails. Depending on the order I compute the collisions (1-3 first or 2-3 first), I will get different results. Repeated iteration through the collisions will still give order dependent

How to handle multiple simultaneous elastic collisions?

只谈情不闲聊 提交于 2020-02-26 10:04:25
问题 I'm computing the result by colliding pairs of 2D convex objects (without rotation), using the basic equations on wikipedia. However, when there are dependencies, like two objects hitting another object at the same time: Such as here, with objects 1 and 2 hitting 3 at the exact same time, the pair-wise approach fails. Depending on the order I compute the collisions (1-3 first or 2-3 first), I will get different results. Repeated iteration through the collisions will still give order dependent

Camera following Rigidbody jitter every few seconds with background objects

坚强是说给别人听的谎言 提交于 2020-02-25 06:58:39
问题 Camera following Rigidbody2D jitter every few seconds with background (non rigidbody) objects (Obstacles). The FPS in profiler is fine it is near to 100. also Interpolate is also fine. Using Unity 2017.4.12 (LTS) GIF GIF Video here Camera Follow Script public class CameraFollow : MonoBehaviour { public float followRange = 0.5f; public float cameraZ; public Transform Player; public Vector3 newPos; void Start () { cameraZ = transform.position.z; } void FixedUpdate() { newPos = new Vector3