Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

Crashing issue related to changing velocity

$
0
0
What I'm trying to do is get an object's velocity to change with a smooth transition. The code is supposed to decrease the y-velocity by 0.1 each frame, until it reaches -2.5. However, whenever the code is executed, Unity freezes and becomes unresponsive. Does anyone know what the issue is? void MoveDown() { while (rb.velocity.y > -2.5) { Vector2 newV; newV.x = 0f; newV.y = -.1f; rb.velocity += newV; } }

Viewing all articles
Browse latest Browse all 2383

Trending Articles