Alternative (or perhaps better way) for SetEntityCoordsNoOffset?

Hello everyone!

I’m working on the Ferris wheel and Rollercoaster and they are almost done, however the CPU usage is immersive due to the code. It’s based on the two decompiled files of GTA as well as the work from @manups4e (thanks a lot!).

So, my issue is… is there a an alternative of “SetEntityCoordsNoOffset” that can “move” the cabins alongside with the wheel or a way to reduce the load from this loop? It’s called each tick so the movement of the cabins can be synchronized with the one from the ferris wheel.

				for (int ss = 0; ss < 16; ss++)
				{
					float x = 6.28319f / 16 * ss;
					Vector3 offset_cabin = GetOffsetFromEntityInWorldCoords(Wheel.Entity.Handle, 0f, CustomMath.Deg2rad(15.3f) * CustomMath.Rad2deg((float)Math.Sin(x)), CustomMath.Deg2rad(-15.3f) * CustomMath.Rad2deg((float)Math.Cos(x)));
					SetEntityCoordsNoOffset(Cabins[ss].Entity.Handle, offset_cabin.X, offset_cabin.Y, offset_cabin.Z, true, false, false);
				}

Thanks!

So far i didn’t find anything better and yeah they are really a lot cpu consuming… because you’re calling 16times natives per frame

1 Like

Maybe this can help? SLIDE_OBJECT - Cfx.re Docs

Or, If I am correct cabins are not connected to ferris wheel right? They are separate objects? Maybe you can attach those cabins to wheel ( AttachEntityToEntity), and then you only need to rotate a wheel?

1 Like

Thanks, that was my initial thought but as far as I saw the ferris wheel prop doesn’t have a skeleton - Screenshot by Lightshot or I’m wrong and looking at elsewhere?

I can do a “hackfix” and replace the model of the wheel from the decompiled files with another one - ‘p_ferris_wheel_amo_p’ which has bones, but idk if that’s a proper solution… but fuck it, as long as there’s nothing major visual and performance drops (with more than 80%) i’m fine with it.