Tag Info

New answers tagged

1

The basic cause of the problem was that my value for screenY (2D location of mouseclick on Y-axis) was incorrect and so passing it to any valid picking ray function returned invalid results. My old working project got the mouse position values from the org.lwjgl.input.Mouse class whereas the new project is using java.awt.event.MouseListener. The lwjgl ...


1

Unless your projectile is going slow enough to see you probably don't want to spawn it using physics and then throw it. It's really to end up with a lot of unwanted behavior this way. Instead, I'd use Physics.Raycast and then use the resulting RaycastHit to see what you hit. In order to raycast: RaycastHit hit; if ...


1

You're using the RayCast and DrawRay methods incorrectly. Both call for a direction for their second parameter, and you're passing in a position. In the case of the RayCast you probably want your direction to be the fwd variable you create using turret.forward.


1

The simplest thing to do given your existing code, assuming there are no other complications, is to check both on the dx step and the dy step. def get(x, y): # minimize code duplication return level.get_at((round(x), round(y)), True) while t < 5000: t += 1 x += dx obj = get(x, y) if obj: break y += dy obj = get(x, y) ...



Top 50 recent answers are included