When discussing the animations in the comment section of my object animation post, @MoltonMontro suggested the awesome idea of employing physics into Unturned objects. Here are the results of my tests:
Using hinge joints, I made a swingset with interactable swings. (NOTE: Only vehicles, not the player can’t affect the swings, I’m not sure why but I think it’s the same reason players can’t affect vehicles by walking into them)
Disabled gravity
Using break force I managed to make a destructible version
As you can see here players can’t affect them at all.
Cube object with rigidbody physics:
Tutorial: Same hierarchy as for animation, but dont rig it this time. Rather have a parent model with child models attached to it with hinge joints and rigidbodies attached to them (parent shouldn’t use gravity and should be kinematic, check YT for tutorials on hinges if you are familiar with them) Both box colliders and capsules work, but don’t give either a physics material (doesn’t work as far as I have tested) If you have destructible parts, make sure to tag/layer them as Vehicle or a similar tag that can collider with the ground
If you want to take a closer look at how it’s made, you can import this Unitypackage (version 5.51f1) and play around with it how much you want!
I wonder what makes grasses move when walking through them though. Too lazy to mess around in-game at the moment to see for sure, but I assume it might just be part of the “wind calculations” so it can be easily disabled for lower-end computers. Probably can’t be utilized in mods then, at least not for things with collision.
It is just a part of the wind calculations. Trees could probably do it to, if they were setup the same as grass. Assuming it was just based on the tag used, then you could still make use of wind calculations (and grass parting) through some iffy workarounds regardless.
Either way, it is totally possible to use in mods. You can do it when you make your own grass, and you can likely do it without the usage of modules by tagging stuff differently.
There arent any “wind physics” at work in Unturned. The reason trees and grass sway, is a shader that causes their vertices to move on screen. The script that nelson uses to move grass out of the way is simple, its a capsule collider around the player model. It’s visible if you make very short or long custom grass. All it is is a script that tells the grass model to bend around the capsule collider, not any sort of physics.