nunuStudio icon indicating copy to clipboard operation
nunuStudio copied to clipboard

Physics coordinates are broken in windows

Open KCGD opened this issue 4 years ago • 4 comments

Physics coordinates are broken in windows

The coordinates of a static physics box in the editor are completley different in-game. Often the y-value will be drastically incorrect in game / testing. What i mean is that when i use a static / kinematic box to apply collision to a surface, the actual collision when testing is somewhere else on the y value. Ive tried switching the project's transformation space between world and local, ive tried checking / unchecking keep pose move, nothing fixed this issue. Also theres no transformation space option for individual physics objects, its only in the editor settings.

this is in version 0.9.6 (201904261147) on windows

KCGD avatar May 31 '20 20:05 KCGD

Hello

When runnin in local mode the physics coordinates should be consistent with the values in the editor but this will only work for for objects directly in the scene root.

World transforms adjusts the coordinates so that the objects keep on the same global position as they were on the editor but this will cause inconsistencies since the physics system does not have the same transform system.

You can access the object.body of your physics objects to check the physics coordinates.

I hope this helps.Thanks a lot! I have to clarify this on the docs :)

tentone avatar Jun 01 '20 08:06 tentone

@tentone i just tried this and the issue still persists, i found what it is though. In game the physics system's y valiues are half of the rest of the engine's (ex: for a plane at y:33 the collision box has to be at y:16.5 for it to register correctly in game. Is there any way to fix this / adjust the scale of the physics engine's y plane?

KCGD avatar Jun 01 '20 14:06 KCGD

I will have to check how the scale is afecting the physics system. Do yoyu have any scaled object in the tree?

Some shapes coordinates are also different (e.g boxes) but does not seem to be the case here?

Can you please share a example project? :) Tahnks a lot!

tentone avatar Jun 03 '20 23:06 tentone

@tentone In this case yes i was using a box to apply collision, however the coordinate missmatch happens for all physics, also i put links to the project below

the project file | the playable project btw you can spam the spacebar to fly around in the project if you run it btw again, this is the same project i was trying to use terrain collision in Thanks for helping so much :)

KCGD avatar Jun 03 '20 23:06 KCGD