Forum rules - please read before posting.

Pick up 3D Object: Wrong scale

edited September 2024 in Technical Q&A

Hi,

I'm working on a First Person game where the player can pick up 3D objects. I've successfully implemented this feature following the First Person tutorial, but I've encountered an issue with an object which has a custom scale.

If I set the object's scale in the scene to 1-1-1 and then modify its scale factor, it doesn't work correctly. The scale appears wrong. My object doesn't have a prefab, I can create one, but the mesh is attached to the original 3d object, not to the prefab.

I'm not sure how to proceed from here.

https://imgur.com/xfZzHwZ
https://imgur.com/B8QUkLI

Comments

  • The Object: Set parent Action won't affect an object's scale - you can do this with the Object: Transform Action.

    Bear in mind, though, that the Scale values in the Inspector account for parent scales as well. That is, an object that initially has a scale of 1 will have a scale of 0.5 if parented to an object that has a scale of 2.

    If you can share full screenshots that show the issue / workflow, I can try to spot what's wrong, but generally you should adjust the Mesh's "Scale Factor" such that it appears in the scene with the correct scale when unparented.

  • Hi Chris,

    I can follow your steps from the YouTube tutorial when you do the setup of the bone saw setup. However, in your tutorial, your 3d object is a full prefab with a transform component, while mine, doesn't have the component. When I click in the 3d prefab it shows me the Model/Rig/Animation... options, but I cannot set any scale like you do in the tutorial.

    https://youtu.be/CimRAPhQvAE?si=0RU8U21P-1qzVicu&t=2474

    When the player picks up the object, I follow your steps and I run an action list with the transform action. (see screenshot attached)

    https://imgur.com/a/2OSV86w

  • I'm not clear on your meaning about what's missing - the Matchbox has both a Transform and a "Scale Factor" field in your screenshot.

    When you use the Object: Transform Action's Copy Marker method, it'll adopt the position, rotation and scale of the Marker. It's best to keep both the moving object, and the Marker, at unit scale - and then adjust the Scale Factor so that the model appears correctly in the scene.

    It raises a good idea for a feature, however: I'll see about updating this Action with individual "Copy Position" "Rotation" "Scale" options for this method.

  • edited April 30

    Hey there!
    I just figured out what was causing that weird issue (sorry it took me a while to dig into it).

    Somehow when the object is moved towards the marker in the First Person controller, like in the tutorial, using the Object:Transform, is changing its scale gradually to 1. The workaround will be to scale the object back to its original dimensions when I have to reuse it again in the scene.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.