Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
How can I move a sprite with a player while using arcade physics with gravity?

I want to have a player that runs around with a gun. Seems like that shouldn't be too hard, but it keeps getting more and more complicated. I thought of using a container, but containers don't allow gravity, so I can't use that. Then I tried using a physics group, which kind of worked. There is a big issue with the physics group though. I can only have gravity on or off for ALL objects in the group which isn't what I want. Obviously I want the player to have gravity and jump around, but the gun shouldn't fall through the world. The player should have gravity, the gun shouldn't. In fact I'm pretty sure the gun doesn't need physics at all. Is there a way to disable gravity for just one object in a physics group? Or is there a better approach to my issue altogether where you don't use a group?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

So it turned out that I'm actually just dumb an containers DO have physics bodies. It didn't work when I tried it, but that was because of something else I did wrong, and not the physics body. It works now if I use a container to move everything together.

about 4 years ago · Juan Pablo Isaza Report

0

I would:

  1. create a custom based on Phaser Sprite / GameObject / Container (depending on the properties needed).

  2. In that custom Object, I would add the needed extra GameObject(s), to the scene, in the constructor.

  3. Update the position(s) of those extra object(s) in the custom object itself, so they would not need/have a own physics body and move in sync with the "base" Sprite.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!