How to Implement Physics


#1

Hi, I am new to Zappar and I am trying to create a simple AR game in it. But I am finding it difficult to implement basic physics properties like gravity, applying force and other such things.
It would be great if you guys can help me out with this problem


#2

So ZapWorks has a problem with Physics like gravity and applying force.
They real only have Trigger Region and Raycaster Docs: https://docs.zap.works/studio/physics/

Now with that said I have a project file made by someone else (Not mine) that uses the Matter.js code in ZapWorks. https://brm.io/matter-js/

Now I haven’t played with it so don’t know how to use it yet. Feel free to play with it.
matterjsPlatform.zpp (122.1 KB)

Steve


#4

Hey @ashishdevden,

We do have a Universal AR + cannon.js physics example over on GitHub: https://github.com/zappar-xr/threejs-example-instant-tracking-cannon-physics/ :slight_smile:

Hope this helps!


#5

Thanx Stevesanerd , i’ll look into this


#6

thanks Deim, i’ll look into this project too


#7

I looked into your project and I believe same can be achieve by integrating universal AR with unity, isn’t it??

And as I am more comfortable with unity, I think that will be a better option for me


#8

Yeah, you can use Unity’s built-in physics system alongside our unity plugin :slight_smile: