How to calculate Counter Move?

im currently using bodyposition to move something, that something is hardstuck with the humanoid rootpart so that when im standing still and move it there is no delay. but when i start moving it lags behind im wondeinrg how to calculate enough counter movement to get it to the accurate position even while moving ( i want to retain a slight delay still like while im not moving ) ?

5 Likes

Im thinking I donā€™t quite understand what you are wanting to achieve.
Will this be in a fixed position in relation to the characters position, or also rotation?

What do you mean about counter movements and slight delays?

3 Likes

sadly this is physics related on an unanchored, cancollide object so if i set the cframe i lose all physics which i must retain

1 Like

Sorry, I posted too quickly an answer then thought better of it and instead asked for a bit more info.

its fine, essentially i have a block, and then an attachment which is relative to the humanoidrootpart cframe meaning if i manipulate its cframe it will still move along with the humanoidrootpart with no delays. if i move still then this block, with a bodyposition, will try to match the location of the attachment and does so with no delays except for the delays in i intentionally put in for a smoother look. now if i move around then the block lags behind or in front or in whatever direction i move in, im trying to calculate a sort of ā€˜counterā€™ movement to make it not lag behind and retain the normal position it would have if i stood still, im sorry for the block of text let me know if you understand it now

I think I understand what you mean.
Do you have any code on what you are doing?
The part where its moving the block to the attachment location?

its just a simple bodyposition.Position = attachment.WorldPosition, i mean it will move it it works as it should there is only a lag behind while moving around which sadly ruins gameplay

you should use AlignPosition instead of BodyPosition so you donā€™t have to constantly set the target position with a script

hi this isnt an issue for me and alignpos simply isnt good enough for my use case and has the SAME problem

what is the ā€œsomethingā€ that moves? can it be created clientside to not lag behind the character?

also, why is alignposition not good enough? wouldnt it be better to not constantly be running a script?

its a block on the client side

for my use case bodypositions along with a bodygyro offer me more customizability, better physics (in this use case at least) and they can be made to be instant while retaining physics which alignpos cant - as soon as you turn rigidity on physics are gone for that part you are moving, keep in mind alignpos has the same problem

I feel like the lack of code is really hurting you, in the way of getting any sort of actual help on this.
If we can see exactly what is happening we may see something that you missed, or at least better understand why you are doing it the way you are doing it.

can you show a recording of how the block lags behind?

@SelDraken @Mayorfoxia82

in the beginning you can see how i move it around and it looks smooth, but as soon as i start moving my character that delay happens. i was just thinking of a sort of movement overshoot to compensate for the character movement, i apologize for wording it as ā€˜counter-movementā€™. id just like to keep the behaviour i have normally while not moving while compensating for character movement. i hope you understand me better now

i posted a recording, i hope you can understand me better now

I see what you mean, when you move the controllers, the spheres stick to them, but when you move the camera, they lag behind.

I really have no idea what would cause this.
I would probably need to look at some code to see how you are moving them, or telling them to follow the controllers.
It would be something that I would have to try different things and experiment.

Maybe someone here knows more about the camera movement vs a controller type movement.
Maybe its specific to VR, not sure.

Hope someone has some more information on this than I do.