fivem icon indicating copy to clipboard operation
fivem copied to clipboard

[BUG] vehicle tornado problem

Open BugCode1 opened this issue 1 year ago • 7 comments

What happened?

Sometimes, for various reasons, the entities attached to a ped come out of no-collision mode. When the player gets into a vehicle, due to the collisions between these entities, the car can behave erratically and collide with the ground and air like a tornado.

Additionally, if an entity with collision is attached to you, you can move vehicles like a deflated ball.

Expected result

It is a good idea to ensure that the collision of all entities attached to a ped is removed when entering vehicles, or that there is no collision at all between the entities attached to the ped and the vehicles, to prevent issues like this from occurring.

Reproduction steps

  1. attach a entity with collision to your self

https://github.com/citizenfx/fivem/assets/26005436/f87d9486-6f38-4c4a-9967-3f3840aaa08a

Importancy

There's a workaround

Area(s)

FiveM

Specific version(s)

All Versions

Additional information

No response

BugCode1 avatar May 23 '24 03:05 BugCode1

Hmm, we used to have this issue all the time but fixed it by disabling collisions on all spawned objects.

This also isn't a FiveM Bug (nor a bug in general).

AvarianKnight avatar May 23 '24 04:05 AvarianKnight

Yes, in fact, this alone is not considered a bug.

However, when you attach an entity without collision to a ped, due to some unknown events over time, this entity regains collision. Additionally, some cheaters create this problem by attaching a small object with collision inside their own body.

Actually, I think the presence of collision between the entities attached to a ped and a vehicle is completely redundant and it is better to remove it from the FiveM side.

BugCode1 avatar May 23 '24 04:05 BugCode1

The "tornado" was something iirc when you attach a entity and switch routing bucket

CeebDev avatar May 23 '24 15:05 CeebDev

This could be one of the possible scenarios, but it is not the only one. There are other possibilities as well.

Considering that I have seen this problem in servers that have not used Routing Bucket also we have had this problem since the early days of FiveM (before the existence of Routing Bucket).

One of the cases that creates this problem with a very rare chance (due to bad network or desync servers with +128 players) is teleporting, which suddenly restores all collisions of the attached objects.

BugCode1 avatar May 23 '24 16:05 BugCode1

Interestingly, this issue has become significantly more frequent recently for seemingly no reason, just a month ago this issue was very rare and now it's a daily occurrence, we haven't added anything recently that would be attaching more objects to players either.

jellyton255 avatar May 25 '24 02:05 jellyton255

This 'bug' exists for multiple years now -> https://forum.cfx.re/t/1636310

There are two different problems here:

  • When an entity that has another entity attached to itself gets 'deleted', CEntityScriptGameStateDataNode -> usesCollision of the prev. attached entity gets flipped to true (which is fine).
  • If a player disconnects and another player is in scope of the prev. attached entity, migration doesn't flush CPhysicalAttachNodeData as this is handled by the entity-owner who got removed in the same frame. This results in a re-attachment of the entity (with collision due to the above mentioned behavior) when a player with the same slotId enters the scope of the prev. attached entity.

(The same happens if the routing bucket of the target player is switched, as this also invokes ClearClientFromWorldGrid)

Flushing CPhysicalAttachNodeData when an entity is migrating is maybe an option here as this can only happen if the parent-entity doesn't exist anymore.

tens0rfl0w avatar May 25 '24 03:05 tens0rfl0w

Had this happen to a player who was idle, switched on his engine and then starting spinning https://medal.tv/games/gta-v/clips/i0gjaScWwZgeC6ap_/d1337IzrZ5CR?invite=cr-MSxIaUMsNjYzNDYyNjIs

Randolio avatar Jun 04 '24 22:06 Randolio