Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player vehicle camera ignores collisions of placed objects when moving above certain speed #1921

Closed
LeXDDD opened this issue Dec 15, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@LeXDDD
Copy link

LeXDDD commented Dec 15, 2020

Describe the bug

Camera ignores any placed object collisions when player in vehicle reaches certain speed.

To reproduce

  1. Create any building/road or any other, preferably big, object on map in clear space.
  2. Get into any vehicle that can accelerate and move beyond 40km/h.
  3. While in vehicle, move close to the placed object, rotate camera in the direction of placed object.
  4. When reached 40 km/h, camera will ignore created object collision and clip inside/past object.

Expected behaviour

Camera wont ignore objects collisions and will close up to player/move in front of the object, as it would when player moving in vehicle nearby any base game world objects.

Screenshots

0355
0352

Version

1.5.7-9.20358.0, 1.5.8
Windows 7

Additional context

https://www.youtube.com/watch?v=GsedO_5iSBY
This issue only occurs when player in vehicle, and total sum of velocity values in both x, and y is above ~0.4.
While on foot this doesnt seem to happen, despite player moving with same or higher velocity.
Any setCameraClip values dont affect issue in any way.
Seems like same effect, but affecting only player vehicle, can be spotted in base game when moving above 40km/h, which will make camera ignore player vehicle collision and clip through. Other than that one instance i was unable to find same effect affecting anything else in base game.

@LeXDDD LeXDDD added the bug Something isn't working label Dec 15, 2020
@xLive

This comment has been minimized.

@LeXDDD
Copy link
Author

LeXDDD commented Dec 15, 2020

https://community.multitheftauto.com/?p=resources&s=details&id=18365
Quick resource made for testing purpouses, includes:
objects created on server and client sides(left side objects with hill creation scripted in client script, right side objects with buildings in server script);
separate building and object isLineOfSightClear triggers between player vehicle and camera positions;
setCameraClip switch by using /clip5 which only seems to affect base game world objects;
additional info box with all necessary parameters.
Teleport to testing area /cake5.
Perhaps introducing building attribute to object class , might solve this issue, since all of the MTA created objects, camera wise, are treated same way as dynamic base game objects such as lamp poles and boxes.

@lopezloo
Copy link
Member

lopezloo commented Jan 20, 2022

Fixing this by default for all objects would break race DM maps as they rely on this behaviour so some switch needs to be provided. Either global or per object element.

@Pirulax
Copy link
Contributor

Pirulax commented Jan 20, 2022

Perhaps setGlitchEnabled

@lopezloo
Copy link
Member

Most likely fixed by #3274. Feedback appreciated.

@lopezloo lopezloo added the feedback Further information is requested label Jul 24, 2024
@Fernando-A-Rocha
Copy link
Contributor

I tested with this code and by driving (as you can see in the video below) that #3274 resolved this. Issue can be closed.

setElementPosition(getPedOccupiedVehicle(localPlayer) or localPlayer, 0, 0, 11)
createBuilding(8357, 0, 0, 10, 0, 0, 0, 0)
createObject(8357, 40.5, 0, 8, 0, 0, 0)

https://streamable.com/w68bt4

@Fernando-A-Rocha
Copy link
Contributor

  1. Create any building/road or any other, preferably big, object on map in clear space.
  2. Get into any vehicle that can accelerate and move beyond 40km/h.
  3. While in vehicle, move close to the placed object, rotate camera in the direction of placed object.
  4. When reached 40 km/h, camera will ignore created object collision and clip inside/past object.

This remains true for Objects (we can say this is an intended behavior of dynamic objects) but not for Buildings, which don't allow your camera to clip inside/past the model like that (normal behavior of world objects indeed).

@lopezloo
Copy link
Member

Fixed in #3274.

@lopezloo lopezloo removed the feedback Further information is requested label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants