Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
Cast a ray in phaser 3?

I'm making a shooter game in phaser 3, and I'm wondering if there is a way to cast a ray from a game object in one direction using either an angle or two pairs of coordinates, maybe like this?

this.ray = this.physics.add.ray(this.player.x, this.player.y, this.pointer.worldX, this.pointer.worldY);
this.physics.add.collider(this.ray, this.someEnemy, () => {
    alert("you hit something!")
})

or maybe like this?

this.ray = this.physics.add.ray(this.player.x, this.player.y, Phaser.Math.RAD_TO_DEG * Phaser.Math.Angle.Between(this.player.x, this.player.y, pointer.worldX, pointer.worldY);)
this.physics.add.collider(this.ray, this.someEnemy, () => {
    alert("you hit something!")
})
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda