Posts: 13
Threads: 3
Joined: Jan 2022
Reputation:
0
31-01-2022, 07:13 PM
Hello everyone. I immediately apologize for my English, I will use google translator))
I'm making a game where the player has to use hooks to get to the top of a mountain. If anyone did similar mechanics, tell me what settings you used.
The screenshots show what settings I used, but my game hangs very badly on mobile devices.
Have I used the settings correctly?
Or is there an alternative setup and architecture?
Thanks in advance!
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(31-01-2022, 07:13 PM)Kizzualx Wrote: Hello everyone. I immediately apologize for my English, I will use google translator))
I'm making a game where the player has to use hooks to get to the top of a mountain. If anyone did similar mechanics, tell me what settings you used.
The screenshots show what settings I used, but my game hangs very badly on mobile devices.
Have I used the settings correctly?
Or is there an alternative setup and architecture?
Thanks in advance!
Hi!
First thing that caught my eye is that you’re using Oni as your backend. This should only be used as a fallback in case Burst is not available for whatever reason, since it’s slower (specially so on mobile)
As a first step, Install the Burst dependencies as per the manual’s setup guide and switch to the Burst backend:
http://obi.virtualmethodstudio.com/manua...setup.html
http://obi.virtualmethodstudio.com/manua...kends.html
Posts: 13
Threads: 3
Joined: Jan 2022
Reputation:
0
(31-01-2022, 09:05 PM)josemendez Wrote: Hi!
First thing that caught my eye is that you’re using Oni as your backend. This should only be used as a fallback in case Burst is not available for whatever reason, since it’s slower (specially so on mobile)
As a first step, Install the Burst dependencies as per the manual’s setup guide and switch to the Burst backend:
http://obi.virtualmethodstudio.com/manua...setup.html
http://obi.virtualmethodstudio.com/manua...kends.html Thanks a lot.
Now I'm facing another problem.
I have a rope. The start is related to the player ( Obi Particle Attachment (Dynamic)) . The end is tied with a hook (Obi Particle Attachment (Dynamic)).
When I throw a hook with (rope.velocity) the hook comes off the rope and the player.
I also get 2 errors. The first with the build. Second when stopping the game process
I apologize for such stupid questions. But these problems I can't solve on my own
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(01-02-2022, 09:19 AM)Kizzualx Wrote: When I throw a hook with (rope.velocity) the hook comes off the rope and the player.
There's no such thing as "rope.velocity". Ropes don't have a velocity, since each individual particle in them might have a different velocity. May you share the code you're using to do this?
(01-02-2022, 09:19 AM)Kizzualx Wrote: I also get 2 errors. The first with the build. Second when stopping the game process
This means you rope's transform is invalid (that is, cannot be decomposed into a rotation+translation+scale):
https://docs.unity3d.com/ScriptReference...idTRS.html
which means there's some very weird stuff going on in your scene. What's your rope's transform values?
Posts: 13
Threads: 3
Joined: Jan 2022
Reputation:
0
(01-02-2022, 09:57 AM)josemendez Wrote: There's no such thing as "rope.velocity". Ropes don't have a velocity, since each individual particle in them might have a different velocity. May you share the code you're using to do this?
This means you rope's transform is invalid (that is, cannot be decomposed into a rotation+translation+scale):
https://docs.unity3d.com/ScriptReference...idTRS.html
which means there's some very weird stuff going on in your scene. What's your rope's transform values? Please tell me how to do the following:
I need a rope, and there should be a ring at the end. The player must throw the ring and catch on the hook. Thus, he must hang on a rope that is hooked by a ring on a hook.
Like this...:
Above the message, I incorrectly said ("rope.velocity"). I throw not a rope, but a ring at the end of the rope
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
01-02-2022, 11:00 AM
(This post was last modified: 01-02-2022, 11:45 AM by josemendez.)
(01-02-2022, 10:10 AM)Kizzualx Wrote: Please tell me how to do the following:
I need a rope, and there should be a ring at the end. The player must throw the ring and catch on the hook. Thus, he must hang on a rope that is hooked by a ring on a hook.
Like this...:
Use a dynamic attachment to attach the rope to the ring and the player, then apply an impulse to the ring's rigidbody to launch it, simple as that.
The devil is in the details though. You must make sure that the transform hierarchy in your scene makes sense, and be wary of attaching the rope inside a collider, if they're both set to collide with each other (as this will cause jittering): use collision filtering to deactivate collisions between the ends of the rope and the character/ring.
Note: I see in your screenshots that your ring has two colliders, but only one if them has a ObiCollider (the circle collider, which is disabled). Each collider must be wrapped by a ObiCollider in order to work with Obi, keep that in mind.
let me know if you need further help,
Posts: 13
Threads: 3
Joined: Jan 2022
Reputation:
0
01-02-2022, 12:06 PM
(This post was last modified: 01-02-2022, 01:06 PM by Kizzualx.)
(01-02-2022, 11:00 AM)josemendez Wrote: Use a dynamic attachment to attach the rope to the ring and the player, then apply an impulse to the ring's rigidbody to launch it, simple as that.
The devil is in the details though. You must make sure that the transform hierarchy in your scene makes sense, and be wary of attaching the rope inside a collider, if they're both set to collide with each other (as this will cause jittering): use collision filtering to deactivate collisions between the ends of the rope and the character/ring.
Note: I see in your screenshots that your ring has two colliders, but only one if them has a ObiCollider (the circle collider, which is disabled). Each collider must be wrapped by a ObiCollider in order to work with Obi, keep that in mind.
let me know if you need further help, So I can't figure out how to set it up.
http://obi.virtualmethodstudio.com/manua...aints.html
Here at the end of the topic, an example of my problem is given.
The screenshots show what happens to me. I have one side of the rope pulled away from the ring collider. And I want the end of the rope to be strictly in the ring collider, and not go beyond this collider
How can I make the dot always be in this position relative to the player?
After the start, she leaves somewhere))
Before start>
after start>
Posts: 13
Threads: 3
Joined: Jan 2022
Reputation:
0
01-02-2022, 01:41 PM
(This post was last modified: 01-02-2022, 01:43 PM by Kizzualx.)
One more test...
connect:
after start play mode:
Used addForce to throw the ball:
How can I fix this connection?
This is my main problem, and the last problem=)))
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(01-02-2022, 12:06 PM)Kizzualx Wrote: So I can't figure out how to set it up.
http://obi.virtualmethodstudio.com/manua...aints.html
Here at the end of the topic, an example of my problem is given.
The screenshots show what happens to me. I have one side of the rope pulled away from the ring collider. And I want the end of the rope to be strictly in the ring collider, and not go beyond this collider
How can I make the dot always be in this position relative to the player?
After the start, she leaves somewhere))
If your rope is attached inside a collider, you want to deactivate collisions between the rope and the collider so that the collider does not take the rope out. You do this by using collision filters (see collision filtering: http://obi.virtualmethodstudio.com/manua...sions.html). You can set filters on both the rope and the collider, once possible solution is to enter the rope's path editor, select the control point that's inside the collider, and set it to collide with everything except the collider's category.
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
01-02-2022, 01:46 PM
(This post was last modified: 01-02-2022, 01:48 PM by josemendez.)
(01-02-2022, 01:41 PM)Kizzualx Wrote: One more test...
connect:
after start play mode:
Used addForce to throw the ball:
How can I fix this connection?
This is my main problem, and the last problem=)))
A force of 5000 newtons is huge. Dynamic attachments are constraints, which means they use forces to keep the rigidbody and the rope together. If you add a huge force to the body, it will initially separate until the constraint can be met again.
You can increase precision by spending more iterations on pin constraints (in the ObiSolver, under constraints: http://obi.virtualmethodstudio.com/manua...olver.html)
Also, make sure you're using the same interpolation scheme in both your rigidbodies and your Obi Solver. Your rigidbody is not using interpolation, so neither should your solver. Interpolation introduces a 1-frame delay in rendering with respect to physics, which can result in objects lagging behind other objects that aren't interpolated.
|