@lazybitgames what options can I tinker with to make vehicles more optimized when:
Iâm trying to set my vehicles in sleep mode at begin but the Sleep function doesnât seem to be doing anything. I set the sleep threshold to a very high value in the default settings of the vehicle and it checked using the âget is sleepingâ function and it seems to be flip flopping around alot.
Edit: I just stumbled upon the fact that vehicle sleeps if itâs in the air aka not touching the ground, and only found this out because the linear and angular thresholds were set to the biggest float value so it just froze in mid air. However, when I overlapped/hit it, it unfroze again and while in air, froze again, but if hit by ground it stopped freezing/sleeping.
How can I utilize this to make them sleep on the ground?
Edit 2: The sleep function seems to be a bit random, I took the vehicle quite some distance away and then exited it and it went to sleep immediately, disregarding the ground now, this was a 4 wheeled truck though, so no hit between the body and ground could be a reason unlike the bike. Would appreciate more insight on this. I also noticed that the vehicle defaults to sleep if it spawns far from my character, but spawns awake if near my character, despite spawning in mid air, not touching the character. Iâm having a hard time trying to find out what things cause the vehicle to prevent sleeping. I am trying multiple asset combinations near the vehicle and the vehicle seems to sleep well in isolated tests but then I put it in the actual level with all things combined and it stops sleeping.
Edit 3: Okay so I found out what asset was causing the vehicles to not sleep, but the problem is that the asset has two sphere collisions used to spawn NPCs and vehicles when the player is close, and one is set to NoCollision while the other is set to ignore everything except âPawnâ. My vehicles have meshes that are all either âVehicleâ or âVehicle Chassisâ so in theory, they shouldnât even be overlapping, let alone colliding. I also checked overlapping with my characterâs overlap spheres and it seems that if the vehicle spawns while overlapping an overlap collision even, it does not sleep, this is why the vehicle spawns awake near my character because I have a large overlap collision around my character too.
These are the collision settings for the large asset that spawns NPCs and vehicles
TLDR: The vehicle stops sleeping completely if it is left idle/spawned inside any overlap collision despite collision settings. However, in order to awaken the vehicle again, a hit is required, not just overlap.
Also, how can I have the handbrake be constantly applied to vehicles at begin play? I tried Set Inputs function with Hb Checked at begin play but vehicle still rolls off slopes