(10-09-2025, 01:40 PM)Qriva0 Wrote: You are right, maybe my last example was just bad.This is not a difficult problem. You can use Unity's joint. It can take care of all of the problems as long as you set its properties correctly. You can set the X/Y/Z limit so the rod can be pulled to 0 instead of -2. Then use a dynamic attachment in the middle of the rod to pull the rod (add force on this attachment object). Actually this is exactly what I did in my fishing game: I use this way to pull the fishing rod and it can only be pulled up to a max angle. And in fishing the rod can be pushed down to a min angle.
Consider rod controlled by some input number - starts with 0, then over time goes to 5. Every update rod velocity is upated to: inputDelta / dt.
After traveling 3 meters rod hits the wall, in result force is applied, but wall stops it from moving. In the end desired input was 5, while rod stopped at 3.
Then I pulled rod back to 0 (via input) and in result rod will end up in -2. This is the second setup I had (first one was just simple rigidbody attachment) and to fix that problem I still tried to move one particle to desired position - it worked similary to static attachment, but that obviously forces rod into unstable state.
But I noticed this approach is simply wrong and I need different solution.
|
Help Scripting rod forces
|
|
|
|
« Next Oldest | Next Newest »
|
| Messages In This Thread |
|
Scripting rod forces - by Qriva0 - 08-08-2025, 06:33 PM
RE: Scripting rod forces - by chenji - 11-08-2025, 03:18 AM
RE: Scripting rod forces - by josemendez - 11-08-2025, 08:31 AM
RE: Scripting rod forces - by Qriva0 - 11-08-2025, 11:14 AM
RE: Scripting rod forces - by josemendez - 11-08-2025, 11:26 AM
RE: Scripting rod forces - by Qriva0 - 11-08-2025, 12:25 PM
RE: Scripting rod forces - by josemendez - 11-08-2025, 12:48 PM
RE: Scripting rod forces - by Qriva0 - 11-08-2025, 03:24 PM
RE: Scripting rod forces - by Qriva0 - 25-08-2025, 11:30 AM
RE: Scripting rod forces - by josemendez - 25-08-2025, 12:12 PM
RE: Scripting rod forces - by Qriva0 - 25-08-2025, 02:11 PM
RE: Scripting rod forces - by josemendez - 25-08-2025, 02:36 PM
RE: Scripting rod forces - by Qriva0 - 25-08-2025, 03:59 PM
RE: Scripting rod forces - by Qriva0 - 08-09-2025, 04:01 PM
RE: Scripting rod forces - by chenji - 09-09-2025, 02:46 AM
RE: Scripting rod forces - by Qriva0 - 09-09-2025, 09:56 AM
RE: Scripting rod forces - by chenji - 09-09-2025, 10:07 AM
RE: Scripting rod forces - by josemendez - 09-09-2025, 02:18 PM
RE: Scripting rod forces - by Qriva0 - 10-09-2025, 09:39 AM
RE: Scripting rod forces - by chenji - 10-09-2025, 10:02 AM
RE: Scripting rod forces - by josemendez - 10-09-2025, 10:25 AM
RE: Scripting rod forces - by Qriva0 - 10-09-2025, 11:48 AM
RE: Scripting rod forces - by josemendez - 10-09-2025, 12:06 PM
RE: Scripting rod forces - by Qriva0 - 10-09-2025, 01:40 PM
RE: Scripting rod forces - by josemendez - 10-09-2025, 03:28 PM
RE: Scripting rod forces - by Qriva0 - 30-10-2025, 02:33 PM
RE: Scripting rod forces - by josemendez - 31-10-2025, 08:42 AM
RE: Scripting rod forces - by Qriva0 - 31-10-2025, 01:05 PM
RE: Scripting rod forces - by josemendez - 03-11-2025, 10:02 AM
RE: Scripting rod forces - by chenji - 11-09-2025, 01:15 PM
|

