overte icon indicating copy to clipboard operation
overte copied to clipboard

Position in server script does not update value

Open ReggaeRambo opened this issue 1 year ago • 2 comments

I want to build a fruit ninja like game, but facing the following problem:

It spawns fruits or bombs with velocity and gravity. When it reaches a lower bound in y-direction, they should disappear. The server script on the main-object caches all spawned fruit IDs in an array and loops through the positions of all spawned fruits by their ID.

The problem is, that the position is always the spawn-position/first-grabbed-position and it does not update, so they never get destroyed...

When the same script is run as a client script, the position gets updated properly!

fruit_warrior_folder.zip

ReggaeRambo avatar Apr 10 '24 05:04 ReggaeRambo

Looking at this it looks like this might be a side effect of the fact that the entity mixer does not simulate physics and so does not update the position of anything based on physics movement.

vegaslon avatar Apr 14 '24 23:04 vegaslon

I believe I have a fix for this in #894 but it would be great if someone else could test it

HifiExperiments avatar Jul 20 '24 00:07 HifiExperiments