|
|
Rope weight effect on rigidbodies |
Posted by: hermonir - 24-06-2020, 02:24 PM - Forum: Obi Rope
- Replies (1)
|
|
Hi,
I have a rope with two pin constraints that attach it to a fixed collider on one side and to a rigidbody on the other side.
The rigidbody moves in the scene. I need the rope to affect it physically - pull it down because of the rope's mass. As the rigidbody moves away and the rope stretches between the fixed point and the rigidbody, it should also pull the rigidbody sideways, toward the fixed point.
Is this possible? Changing the particles mass for the rope did not change anything in this regard.
Thanks
|
|
|
Disk Radius Script Not Working |
Posted by: goldenmommy - 24-06-2020, 10:23 AM - Forum: Obi Fluid
- Replies (2)
|
|
Hello,
I'm trying to modulate the disk radius every frame. Should be very simple:
public Obi.ObiEmitter haloEmitter;
public Obi.ObiEmitterShapeDisk disk;
void Start()
{
disk.radius = .1f;
}
void Update()
{
disk.radius += .06f;
}
And, indeed, in the inspector the radius increases over time, but the result is not rendered -- it stays at whatever radius is set in the inspector before I enter game mode. In fact, whenever I set the radius in script, the result is not rendered, even if I simply assign it a value in Start(). Any suggestions?
|
|
|
Bouncy Soft Body |
Posted by: iliakot - 23-06-2020, 07:17 PM - Forum: Obi Softbody
- Replies (3)
|
|
Is there a way to make soft body bounce from the floor? Similar to what can be achieved with Physic Material and Colliders in standard Unity's PhysX. Bounciness is missing from Obi Collusion Material. Thanks in advance for any reply or suggestion how it can be implemented.
|
|
|
(5.3) ObiCloth passes through colliders when instantiated as prefab |
Posted by: caldorf - 23-06-2020, 10:31 AM - Forum: Obi Cloth
- Replies (3)
|
|
Just purchased and am really impressed with Obi Cloth overall.
I am using it to build a run time level editor in Unity.
I have a prefab for a character that is lying down with a blanket on top. The blanket is an ObiCloth. The configuration of the cloth was copy and pasted from the ClothStaticMeshCollider sample scene.
My prefab works when I drag and drop the prefab from the "Project" window in the IDE at both build and run time. The cloth properly collides with the colliders, etc... Looks great.
However, when I try to instantiate the same exact prefab from a script, the cloth passes directly through the colliders, and drops through the ground and into the bottomless abyss.
This script is triggered at runtime when I point and click where I want the object with the cloth applied to it to appear.
I instantiate the prefab with something like the below snippet:
Code: // NOTE:
// "type" is set at build time in the inspector
// to the same prefab that works when I drag and drop it into a scene
Public GameObject type;
GameObject w = Instantiate(type);
The prefab is made up of (1) my character model, (2) a bunch of capsule colliders w/ ObiColliders for the character, (3) a plane with another collider w/ ObiCollider, and (4) the Obi cloth.
When I inspect the instantiated prefab all the components and hierarchy are the same when it's instantiated via script or IDE.
I've tried programmatically adding the solver, and changing the phases for the colliders. In both cases I found a way to make it work when I drag at drop the prefab from the Project window in the IDE into my scene. However, I've still not managed to get the obicloth blanket to work when the prefab is instantiated at run-time via script.
Before I dive any deeper I thought I'd check in to see if there is a known fix for this issue.
Any ideas on how to get my prefab to work when programmatically instantiated?
Thank you for your help!
|
|
|
Confused about practical use of substepping Unity Physics |
Posted by: protomenace - 22-06-2020, 05:31 AM - Forum: General
- Replies (4)
|
|
I just got done debugging an awful bug related to sub-stepping Unity physics.
According to http://obi.virtualmethodstudio.com/tutor...aters.html, substepping Unity physics is necessary when using more than 1 substep and performing accurate collisions with Rigidbodies.
I have a game where the player controls a quadcopter drone. To simulate the propellers of my drone, I apply an upward force in FixedUpdate. I have the drone calibrated such that the force applied in FixedUpdate is equal to the mass of the drone, such that under normal circumstances, the drone perfectly hovers in place.
I've been messing around with ObiRope, and got it working somewhat well, but I found that whenever I had an Obi rope in the scene, my drone was no longer capable of hovering in place. I thought maybe the mass of an attached rope was pulling the drone down. So I started decoupling the rope and the drone. I got to a point where the two were in completely separate GameObject hierarchies, nowhere near each other in the scene, and still the presence of the rope in the scene was causing my drone to be incapable of hovering.
Then I started playing around with the ObiFixedUpdater I was using for my rope and I found that if I disabled "Substep Unity Physics" on the updater, my drone was magically able to hover again! I dug into the source code for ObiFixedUpdater and found that it directly calls https://docs.unity3d.com/ScriptReference...ulate.html. So I began to realize the issue with my drone. My drone was falling because Physics was being simulated, including gravity forces, but my FixedUpdate was not being called during this extra Physics.simulate.
I searched these forums and found this post: http://obi.virtualmethodstudio.com/forum...ml#pid6497 where it is suggested to use the ObiUpdater.OnBeginStep callback instead of FixedUpdate to apply forces. So this leaves me confused again and with more questions:
- Doesn't calling Physics.Simulate in addition to the normal unity physics update loop essentially cause Unity's physics simulation to proceed faster than realtime?
- Am I supposed to disable Physics.autoSimulation to use substepping with a FixedUpdater?
- Wouldn't I effectively get the same result from reducing Unity's physics timestep rather than doing the complicated process of substepping Unity physics and then replacing all of my FixedUpdate calls with OnBeginStep callbacks? (Or am I supposed to have FixedUpdate in addition to OnBeginStep?)
Physics substepping seems barely mentioned in passing in http://obi.virtualmethodstudio.com/tutor...aters.html, and it leaves all of these questions unaswered in my mind.
|
|
|
|