Frictional Games Forum (read-only)
[ART] Custom entity not rotating properly - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [ART] Custom entity not rotating properly (/thread-15926.html)



Custom entity not rotating properly - Damascus - 06-07-2012

Me and my partner have made a custom model of a large broken gear, where only half of the outer ring is still present, and I'm trying to rotate it with RotatePropToSpeed.

However when I trigger the script, it ends up rotating around the average center of the model, instead of the central hole of the gear. I placed the central hole of the gear right at 0,0,0 in the Model Editor, but that doesn't seem to help.

We even edited the mesh to place a small invisible plane in the middle of the gap in the hopes that we now moved the 'center' of the model to the gear hole. It still doesn't work. Can anyone help me here?


RE: Custom entity not rotating properly - SilentStriker - 06-07-2012

To be able to use RotatePropToSpeed the entity MUST be a Static entity. So in the model editor you need to choose Object::Static


RE: Custom entity not rotating properly - Damascus - 06-07-2012

It is.

It rotates, just at the wrong point on the model.


RE: Custom entity not rotating properly - FragdaddyXXL - 06-07-2012

I think you can tell it to use an area as an axis for rotation. Try placing an area in the center of your gear, and then tell it to use the area as the OffsetArea. I've never tried this, but maybe it will work.


RE: Custom entity not rotating properly - Your Computer - 06-07-2012

If you use a hinge joint, the child body should be the only thing that rotates.


RE: Custom entity not rotating properly - Acies - 06-07-2012

Rotation of custom models depend on the location of the pivot point in your modeling program. The pivot point should always be at 0,0,0 upon export. Make sure the pivot point / 0,0,0 is located at "the central hole of the gear".


RE: Custom entity not rotating properly - Damascus - 06-07-2012

(06-07-2012, 06:35 PM)Acies Wrote: Rotation of custom models depend on the location of the pivot point in your modeling program. The pivot point should always be at 0,0,0 upon export. Make sure the pivot point / 0,0,0 is located at "the central hole of the gear".
Yeah, I made sure this is the first thing i did when creating the entity.

And I'm inexperienced with joints, but I placed a hinge joint in the center of the gear hole and made the gear's body the "child body". Not sure what else to do, so I went back to test it in game and it's still rotating wrong.


RE: Custom entity not rotating properly - Damascus - 06-08-2012

Edit: Wow, I'm an idiot who did not even see that there's an option for offset area in the Rotate script.