aukimiaukimi
DocumentationTutorialsTipsForumCommunity
aukimi.com
Back to the documentation
JavaScript API
sprite49
math40
input29
animation22
material21
mesh20
vec320
inventory18
postProcess18
scene18
quest16
light14
particles14
render13
ui13
atmosphere12
game12
color11
screen11
camera10
globals10
physics9
skybox9
decal8
draw8
saveSystem8
transform8
dialogue7
lifecycle7
physics2D7
  • setGravity
  • setScale
  • rayCast
  • setJointMotorOn
  • setJointLimitOn
  • getFirstContact
  • getNextContact
terrain7
camera3P6
dayNight6
glow6
storage6
vehicle6
console5
highlight4
pathfinding4
water4
audio3
events3
hud3
physicsCollision3
world3
await modelLoader2
timer2
await timer1
modelLoader1
tween1
JavaScript API·physics2D

physics2D.rayCast

Section: Physics 2D (Box2D)

What it does

physics2D.rayCast takes x1, y1, x2 and y2.

Signature

physics2D.rayCast(x1, y1, x2, y2)

Arguments

  • x1
  • y1
  • x2
  • y2

Example · generated

function update(dt) {  physics2D.rayCast(100, 120, 100, 120);}

physics2D.rayCast is called with values of the shape its signature asks for. The code sits in update(dt), which the engine calls every frame: dt is the time since the last one, in seconds.

Previousphysics2D.setScaleNext physics2D.setJointMotorOn

7 members in physics2D

aukimiaukimiAcademy

Learn aukimi - tutorials, courses and community help.

Learn

  • Documentation
  • Tutorials
  • Tips

Community

  • Forum
  • Community
  • Main site
  • The app

Legal

  • Privacy
  • Terms
© 2026 aukimi. All rights reserved.