Prevent train from pushing players into brushes

Wichilie2

L1: Registered
Nov 10, 2023
15
2
I'm working on a map that has a moving train that passes underneath some brushes. However, when players ride on top of the train they get pushed inside the brushes and become stuck:
2024-01-02 17-58-22.gif

To prevent this I've tried to add a trigger_teleport inside the brush to nudge the player outwards:
1704214531665.png

Unfortunately this leads to very janky movement and is not really a valid solution:
2024-01-02 17-54-34.gif

Does anyone know how I can properly prevent players from getting pushed into the brush? The ideal solution would be one where the player simply stops moving forward once they touch the brushes.
 

Attachments

  • 1704214580794.png
    1704214580794.png
    682.4 KB · Views: 25

LivingLinguini

L1: Registered
May 25, 2021
7
0

Attachments

  • example.jpg
    example.jpg
    293.3 KB · Views: 22
  • trainwebm (2).gif
    trainwebm (2).gif
    6.5 MB · Views: 27
Solution

Wichilie2

L1: Registered
Nov 10, 2023
15
2
I was able to recreate the issue using two brushes and a func_train with the 'Is unblockable by player' flag enabled. I fixed it using ForceEscortPushLogic(2) (https://developer.valvesoftware.com/wiki/Team_Fortress_2/Scripting/VScript_Examples#Improving_player_collisions_on_physics_objects_or_trains)

function Trainfixfunc() { printl("Trainfixfunc called!") ForceEscortPushLogic(2) }
Thank you very much for going through the trouble of recreating the issue, your fix works like a charm! ^^
 

gidi30

L1: Registered
Sep 24, 2022
46
20
Note: you dont need the .nut file for the fix, you can call ForceEscortPushLogic(2) using an output by doing OnMapSpawn || !self || Runscriptcode || ForceEscortPushLogic(2) in the logic auto