|
Post by MonstaWolf on May 13, 2016 13:37:52 GMT
Does anybody know the equation used when linking a skinmesh to a rigidbody? I've got the orientation down but the location is wrong, and I'm trying to figure out how to make it stay with the rigidbody via script. Neither of the objects are properly centered, making it hard to do what I need it to do.
|
|
|
Post by cypermethrin on May 13, 2016 13:58:14 GMT
I'm a bit rusty with RAD, but do you not just line them up and link them, why do you need a script??
Otherwise I see 2 options,
first - centre the skinmesh and rigidbody properly....why would you not do this? second - Jestermon's local to parent script will do the job, one of the most useful scripts ever, just search for it, its on this forum somewhere
|
|
|
Post by MonstaWolf on May 13, 2016 14:04:59 GMT
I'll try that, thanks for the reply
|
|
|
Post by MonstaWolf on May 27, 2016 12:02:04 GMT
Is there a way to use LocalToParent on a car object's wheel?
|
|
|
Post by TinSoldier on May 27, 2016 21:34:59 GMT
First things first -
if this involves the car ridgidbody , to link a skinmesh properly, first remove the car object from any group that it's part of, also do this for the skinmesh you want to link.
press [shift] while right clicking on the car body, this will select the model center. ( edited to include "right".
go to the menubar and select (edit) > (move object to cursor aligned)
now click on the skinmesh to link.
now in 3drads list editor, click to link that skinmesh to the car rigidbody.
You should be done now, but, if the skinmesh is rotated wrong or just not quite aligned the way you want, then you can adjust its position / rotations and scale.
If your linking a tire skinmesh to the cars tire, then follow the same process for each tire, press [shift] and right click a tire to select its object center, then (edit) > (move object to cursor aligned) , then select the tire skinmesh, and again, adjust scale or rotations as needed, then link the skinmesh in the list editor to the carbody as before.
test the project and move the car to see if the skinmeshs are all aligned as needed.
If not go back and repeat for the offending car or tire part of the car, ( you probably misaligned the skinmesh ), it may also be an issue with the skinmesh if the center of the tire is not centered in your modeler before export.. and ideally for the tires you want the custom skinmesh perfectly centered in your modeler before export.
The cars body has it's Y axis set low as though the car was sitting on the ground, so be aware of that if you make a custom car model.
The tires alignment are the most important to avoid wobble when moving the car around, the body isn't so important and can be moved as needed.
Lastly, if your trying to do this in script, it can also be done, but, why bother if 3drad can do it for you already.
|
|
|
Post by MonstaWolf on May 31, 2016 13:16:13 GMT
Well, I can do the linking part easy, that's one of the first things I learned in 3D Rad... I need to know how to do it via script. You'll see why once my game is released.
|
|
|
Post by Karvy on Jun 13, 2016 1:08:45 GMT
I think you are talking about OBJ1position = OBJ2position and OBJ1quaternion = OBJ2quaternion... or not?
|
|
|
Post by TinSoldier on Jun 13, 2016 4:52:59 GMT
Well, I can do the linking part easy, that's one of the first things I learned in 3D Rad... I need to know how to do it via script. You'll see why once my game is released. Well seeing that your being secretive about the reason you want this, let me guess ... I'll assume you want to damage you vehicles and have parts move and or thrown around type of damage.. I guess you are also assuming this requires you to recreate the linking process as a script .... I have never tried this myself, but i believe you can still move parts around as you need with a few scrip commands, without recreating the whole link / alignment process in script.. If i'm wrong... you'll have to share more info on what your doing to get the answer you need, or better yet a sample but simple project that doesnt work the way you want and maybe someone can edit / fix your issue... or script piece to do what you need... PS don't upload your whole project.. you're expecting a lot from someone to look through it all to help you... It's much better to use a small simple project and ask someone to help do what you need in the project, then apply that on a larger scale to what you need.
|
|
|
Post by MonstaWolf on Jun 13, 2016 14:58:44 GMT
Don't worry, I already found a solution I'm all set with it. I was basically trying to make it so that you can choose different cars while still loading in the same project, and since they have different wheelbases, I needed to make the wheel meshes be in different positions but still move properly with the wheel. I ended up using a bunch of placeholder objects attached to the wheels so the script has a proper location to set the actual wheels to. It all works fine now, thanks
|
|