I just finish do a Physics Based Articulated Vehicle. And come across a few functions not exposed to Visual Scripting for physics constraints. These would be good to be able to modify at runtime. these are
Linear Position Strength
Linear Velocity Strength
Max Linear Force
Angular Position Strength
Angular Velocity Strength
Max Angular Force
Exposing these would help with making Physics Based Vehicles with Physic Constraints which intern will help make driving simulation games.
I’ve been trying to use these to make a simple piston, by setting the linear drive velocity target at runtime, but it doesn’t seem to work. I’m using a physics constraint between two meshes with physics enabled. I have a button press to call the function on the piston to set the linear velocity target, and I can see at runtime it fires but it doesn’t look like it updates the physics constraint component.
I’m pretty sure that angular drive target works in real time, use it to steer ski on aerosled. How are you testing it? do you have the same axis set to free/limited? Did you switched on check box of that specific axis in the drive settings?
I have the z axis set to limited and the limit to distance I want piston to be able to extend, I also have the linear drive velocity on with velocity target for z axis at 100 and damping at 10000. When I set the velocity to -100 before runtime, the piston extends when I play, but when I try to set it at runtime in blueprint, it doesn’t work. Not at my computer right now, can post a pic of the blueprint later.
Now that you’ve mentioned it, I do call it every tick actually as target is interpolated. But this is a bit weird that you have to update it all the time. Will it get back to default value as soon as you stop setting target?
Yeah, that thing too. What I usually do is call Wake Rigid Body on player input.
Curious how your setup works as I’m planning to add animated engine into the drive train example. The plan was to bake animation in blender or etc. but animating using constrains is an option on the table too.