How to Move a Parent Object Without Moving Its Child Object


How to Move a Parent Object Without Moving Its Child Object

On the earth of 3D modeling and animation, it is typically obligatory to maneuver objects round in your scene. Nevertheless, typically chances are you’ll wish to transfer a dad or mum object with out shifting its little one objects. This may be helpful for preserving sure objects in place whilst you’re engaged on others.

There are a number of alternative ways to maneuver a dad or mum object with out shifting its little one objects. The tactic you employ will depend upon the software program you are utilizing and the particular wants of your undertaking.

On this article, we’ll talk about the final steps for shifting a dad or mum object with out shifting its little one objects in in style 3D modeling and animation software program. We’ll additionally present some ideas and tips for working with parent-child relationships in your tasks.

unity transfer dad or mum with out shifting little one

Listed below are 10 essential factors about shifting a dad or mum object with out shifting its little one objects in Unity:

  • Guardian-child relationships
  • Rework part
  • Native and world house
  • Transfer dad or mum object
  • Youngster objects stay in place
  • Relative positions maintained
  • Use case: animation
  • Use case: digicam motion
  • Use case: sport object group
  • Finest practices

By understanding and making use of these factors, you possibly can successfully transfer dad or mum objects with out affecting their little one objects, enhancing your workflow and undertaking outcomes in Unity.

Guardian-child relationships

In Unity, objects could be organized right into a hierarchical construction utilizing parent-child relationships. This lets you group and manipulate objects collectively, making it simpler to handle advanced scenes.

  • Guardian object

    An object that incorporates a number of little one objects.

  • Youngster object

    An object that’s contained inside a dad or mum object.

  • Hierarchy

    The association of objects in a parent-child relationship, forming a tree-like construction.

  • Rework part

    A part that shops the place, rotation, and scale of an object within the scene.

Whenever you transfer a dad or mum object, its little one objects will usually transfer with it, as they’re linked collectively within the hierarchy. Nevertheless, there are methods to maneuver a dad or mum object with out shifting its little one objects, which could be helpful in numerous conditions.

Rework part

The Rework part is a basic part in Unity that shops and manipulates the place, rotation, and scale of an object within the scene. It’s hooked up to each object in Unity, together with dad or mum and little one objects.

The Rework part has three predominant properties:

  • Place: The place of the thing in 3D house, represented by its x, y, and z coordinates.
  • Rotation: The rotation of the thing round its x, y, and z axes, represented by Euler angles or quaternions.
  • Scale: The dimensions of the thing alongside its x, y, and z axes, represented by a multiplier worth.

Whenever you transfer a dad or mum object, its little one objects will usually transfer with it as a result of they inherit the dad or mum’s remodel. Nevertheless, you possibly can transfer a dad or mum object with out shifting its little one objects by modifying the dad or mum’s Rework part instantly.

To maneuver a dad or mum object with out shifting its little one objects, you should use the next steps:

  1. Choose the dad or mum object within the Hierarchy view.
  2. Within the Inspector view, find the Rework part.
  3. Click on on the small arrow subsequent to the Place, Rotation, or Scale property to broaden the property.
  4. Enter new values for the x, y, and z parts of the property.
  5. Click on on the Apply button to use the modifications.

By following these steps, you possibly can transfer the dad or mum object with out affecting the positions, rotations, or scales of its little one objects.

This method could be helpful in numerous conditions, equivalent to animating a dad or mum object independently of its little one objects, shifting a dad or mum object to a brand new location whereas preserving its little one objects in place, or organizing objects within the scene hierarchy.

Native and world house

In Unity, objects exist in each native house and world house. Native house is the house relative to the thing itself, whereas world house is the worldwide house of the scene.

  • Native house

    The house that’s centered on the thing’s pivot level. The item’s place, rotation, and scale are outlined in native house.

  • World house

    The worldwide house of the scene. All objects within the scene exist in world house, and their positions, rotations, and scales are outlined in relation to one another.

  • Guardian-child relationship

    When a toddler object is parented to a dad or mum object, the kid object’s native house is nested throughout the dad or mum object’s native house.

  • Shifting a dad or mum object

    Whenever you transfer a dad or mum object, its little one objects will usually transfer with it as a result of they inherit the dad or mum’s remodel. Nevertheless, you possibly can transfer a dad or mum object with out shifting its little one objects by modifying the dad or mum’s Rework part in native house.

By understanding the ideas of native and world house, you possibly can higher management the motion of objects in your scene, together with shifting dad or mum objects with out shifting their little one objects.

Transfer dad or mum object

To maneuver a dad or mum object with out shifting its little one objects, you should use the next steps:

  1. Choose the dad or mum object within the Hierarchy view.
  2. Within the Inspector view, find the Rework part.
  3. Click on on the small arrow subsequent to the Place property to broaden the property.
  4. Enter new values for the x, y, and z parts of the Place property.
  5. Be sure that the “Native” checkbox is chosen subsequent to the Place property. This ensures that you’re modifying the dad or mum object’s place in native house, somewhat than world house.
  6. Click on on the Apply button to use the modifications.

By following these steps, you possibly can transfer the dad or mum object with out affecting the positions of its little one objects. The kid objects will stay of their authentic positions relative to the dad or mum object.

Listed below are some further factors to bear in mind when shifting a dad or mum object with out shifting its little one objects:

  • You may as well use the Transfer device within the Scene view to maneuver a dad or mum object with out shifting its little one objects. To do that, choose the dad or mum object after which click on on the Transfer device within the Toolbar. Place the cursor over the dad or mum object after which click on and drag to maneuver it to a brand new location. Be sure that the “Native” button is chosen within the Transfer device choices to maneuver the dad or mum object in native house.
  • If you wish to transfer the dad or mum object and its little one objects collectively, you should use the “Transfer with Youngsters” choice within the Rework menu. This feature will transfer the dad or mum object and all of its little one objects collectively, sustaining their relative positions.
  • You may as well use scripting to maneuver a dad or mum object with out shifting its little one objects. For instance, you could possibly use the next code to maneuver a dad or mum object by 10 items alongside the x-axis in native house:

remodel.localPosition += new Vector3(10, 0, 0);

By understanding how you can transfer a dad or mum object with out shifting its little one objects, you possibly can acquire extra management over the motion of objects in your scene and create extra advanced animations and interactions.

Youngster objects stay in place

Whenever you transfer a dad or mum object with out shifting its little one objects, the kid objects will stay of their authentic positions relative to the dad or mum object. It’s because the kid objects’ positions are outlined in native house, which is relative to the dad or mum object’s house.

  • Native house

    The house that’s centered on the thing’s pivot level. The item’s place, rotation, and scale are outlined in native house.

  • World house

    The worldwide house of the scene. All objects within the scene exist in world house, and their positions, rotations, and scales are outlined in relation to one another.

  • Guardian-child relationship

    When a toddler object is parented to a dad or mum object, the kid object’s native house is nested throughout the dad or mum object’s native house.

  • Shifting a dad or mum object

    Whenever you transfer a dad or mum object, its little one objects will usually transfer with it as a result of they inherit the dad or mum’s remodel. Nevertheless, you possibly can transfer a dad or mum object with out shifting its little one objects by modifying the dad or mum’s Rework part in native house.

By understanding the ideas of native and world house, you possibly can higher management the motion of objects in your scene, together with shifting dad or mum objects with out shifting their little one objects.

Listed below are some further factors to bear in mind about little one objects remaining in place whenever you transfer a dad or mum object:

  • The kid objects will stay of their authentic positions relative to the dad or mum object, even in case you rotate or scale the dad or mum object.
  • You possibly can nonetheless transfer the kid objects individually, even when they’re parented to a dad or mum object. To do that, merely choose the kid object after which use the Transfer device or the Rework part to maneuver it to a brand new place.
  • If you wish to transfer the dad or mum object and its little one objects collectively, you should use the “Transfer with Youngsters” choice within the Rework menu. This feature will transfer the dad or mum object and all of its little one objects collectively, sustaining their relative positions.

By understanding how little one objects stay in place whenever you transfer a dad or mum object, you possibly can create extra advanced animations and interactions in your Unity tasks.

Relative positions maintained

Whenever you transfer a dad or mum object with out shifting its little one objects, the relative positions of the kid objects to the dad or mum object are maintained. Because of this the kid objects will stay in the identical positions relative to the dad or mum object, regardless that the dad or mum object has moved.

It’s because the kid objects’ positions are outlined in native house, which is relative to the dad or mum object’s house. Whenever you transfer the dad or mum object, the kid objects’ native house strikes with it, so the kid objects stay in the identical positions relative to the dad or mum object.

Listed below are some examples of how relative positions are maintained whenever you transfer a dad or mum object with out shifting its little one objects:

  • If in case you have a dad or mum object with a toddler object positioned 10 items to the best of the dad or mum object, and you progress the dad or mum object 20 items to the left, the kid object will now be positioned 30 items to the best of the dad or mum object.
  • If in case you have a dad or mum object with a toddler object positioned 10 items above the dad or mum object, and also you rotate the dad or mum object 90 levels across the x-axis, the kid object will now be positioned 10 items to the left of the dad or mum object.
  • If in case you have a dad or mum object with a toddler object positioned 10 items in entrance of the dad or mum object, and also you scale the dad or mum object by 2, the kid object will now be positioned 20 items in entrance of the dad or mum object.

By understanding how relative positions are maintained whenever you transfer a dad or mum object with out shifting its little one objects, you possibly can create extra advanced animations and interactions in your Unity tasks.

Listed below are some further factors to bear in mind about relative positions being maintained whenever you transfer a dad or mum object with out shifting its little one objects:

  • The relative positions of the kid objects to the dad or mum object might be maintained, even in case you transfer the dad or mum object in world house or native house.
  • You possibly can nonetheless transfer the kid objects individually, even when they’re parented to a dad or mum object. To do that, merely choose the kid object after which use the Transfer device or the Rework part to maneuver it to a brand new place.
  • If you wish to transfer the dad or mum object and its little one objects collectively, you should use the “Transfer with Youngsters” choice within the Rework menu. This feature will transfer the dad or mum object and all of its little one objects collectively, sustaining their relative positions.

By understanding how relative positions are maintained whenever you transfer a dad or mum object with out shifting its little one objects, you possibly can create extra advanced animations and interactions in your Unity tasks.

Use case: animation

One frequent use case for shifting a dad or mum object with out shifting its little one objects is in animation. For instance, you may need a dad or mum object that represents a personality’s physique, and little one objects that symbolize the character’s limbs. You possibly can then animate the dad or mum object to maneuver the character across the scene, whereas preserving the kid objects in place relative to the dad or mum object.

This lets you create advanced animations with out having to animate every particular person little one object individually. For instance, you could possibly create an animation of a personality strolling by merely shifting the dad or mum object ahead within the scene. The kid objects would routinely transfer with the dad or mum object, sustaining their relative positions, so the character would seem like strolling.

Listed below are some further examples of how you should use shifting a dad or mum object with out shifting its little one objects in animation:

  • You possibly can animate a automotive driving by shifting the dad or mum object alongside a path, whereas preserving the kid objects (such because the wheels and doorways) in place relative to the dad or mum object.
  • You possibly can animate a chicken flying by shifting the dad or mum object up and down, whereas preserving the kid objects (such because the wings and tail) in place relative to the dad or mum object.
  • You possibly can animate a tree blowing within the wind by shifting the dad or mum object backwards and forwards, whereas preserving the kid objects (such because the leaves and branches) in place relative to the dad or mum object.

By understanding how you can transfer a dad or mum object with out shifting its little one objects, you possibly can create extra advanced and practical animations in Unity.

Listed below are some further ideas for utilizing shifting a dad or mum object with out shifting its little one objects in animation:

  • Use the “Transfer with Youngsters” choice within the Rework menu to simply transfer the dad or mum object and its little one objects collectively, sustaining their relative positions.
  • Use the “Native” checkbox within the Rework part to maneuver the dad or mum object in native house, in order that the kid objects stay of their authentic positions relative to the dad or mum object.
  • Use animation curves to regulate the motion of the dad or mum object over time, permitting you to create easy and practical animations.

By following the following tips, you possibly can create advanced and interesting animations in Unity utilizing the strategy of shifting a dad or mum object with out shifting its little one objects.

Use case: digicam motion

One other frequent use case for shifting a dad or mum object with out shifting its little one objects is in digicam motion. For instance, you may need a dad or mum object that represents the digicam’s place and rotation, and little one objects that symbolize the digicam’s subject of view, facet ratio, and different settings.

You possibly can then transfer the dad or mum object to alter the digicam’s place and rotation, whereas preserving the kid objects in place relative to the dad or mum object. This lets you create easy and cinematic digicam actions with out having to fret about adjusting the digicam’s settings individually.

Listed below are some further examples of how you should use shifting a dad or mum object with out shifting its little one objects in digicam motion:

  • You possibly can create a cutscene by shifting the dad or mum object to completely different positions and rotations, whereas preserving the kid objects (equivalent to the sphere of view and facet ratio) in place.
  • You possibly can create a first-person digicam by shifting the dad or mum object to observe the participant character, whereas preserving the kid objects (equivalent to the sphere of view and facet ratio) in place.
  • You possibly can create a third-person digicam by shifting the dad or mum object to observe the participant character from a distance, whereas preserving the kid objects (equivalent to the sphere of view and facet ratio) in place.

By understanding how you can transfer a dad or mum object with out shifting its little one objects, you possibly can create extra dynamic and interesting digicam actions in Unity.

Listed below are some further ideas for utilizing shifting a dad or mum object with out shifting its little one objects in digicam motion:

  • Use the “Transfer with Youngsters” choice within the Rework menu to simply transfer the dad or mum object and its little one objects collectively, sustaining their relative positions.
  • Use the “Native” checkbox within the Rework part to maneuver the dad or mum object in native house, in order that the kid objects stay of their authentic positions relative to the dad or mum object.
  • Use animation curves to regulate the motion of the dad or mum object over time, permitting you to create easy and cinematic digicam actions.

By following the following tips, you possibly can create advanced and interesting digicam actions in Unity utilizing the strategy of shifting a dad or mum object with out shifting its little one objects.

Use case: sport object group

Shifting a dad or mum object with out shifting its little one objects will also be helpful for organizing sport objects in your scene.

  • Grouping associated objects

    You possibly can group associated objects collectively by parenting them to a dad or mum object. This may make it simpler to pick, transfer, and manipulate the objects as a gaggle.

  • Creating hierarchies

    You possibly can create hierarchies of objects by nesting dad or mum objects inside different dad or mum objects. This may also help you to prepare your scene and make it simpler to handle advanced objects.

  • Managing visibility and interplay

    You possibly can management the visibility and interplay of kid objects by enabling or disabling the dad or mum object. This may be helpful for hiding or displaying teams of objects, or for stopping gamers from interacting with sure objects.

  • Enhancing efficiency

    In some instances, shifting a dad or mum object with out shifting its little one objects can enhance efficiency. It’s because Unity can extra effectively render and replace objects which might be grouped collectively below a dad or mum object.

By understanding how you can transfer a dad or mum object with out shifting its little one objects, you possibly can higher arrange your sport objects and enhance the efficiency of your Unity undertaking.

Finest practices

Listed below are some greatest practices for shifting a dad or mum object with out shifting its little one objects in Unity:

  • Use the “Transfer with Youngsters” choice.

    Whenever you wish to transfer a dad or mum object and its little one objects collectively, use the “Transfer with Youngsters” choice within the Rework menu. It will be certain that the kid objects preserve their relative positions to the dad or mum object.

  • Use the “Native” checkbox.

    Whenever you wish to transfer a dad or mum object with out shifting its little one objects, be sure that the “Native” checkbox is chosen within the Rework part. It will be certain that the dad or mum object is moved in native house, somewhat than world house.

  • Use animation curves.

    Whenever you wish to create easy and cinematic animations, use animation curves to regulate the motion of the dad or mum object over time. It will can help you create animations which might be extra practical and interesting.

  • Arrange your sport objects.

    Use dad or mum objects to group associated sport objects collectively. It will make it simpler to pick, transfer, and manipulate the objects as a gaggle. It might probably additionally assist to enhance efficiency by permitting Unity to extra effectively render and replace the objects.

By following these greatest practices, you possibly can successfully transfer dad or mum objects with out shifting their little one objects in Unity, enhancing your workflow and undertaking outcomes.

FAQ

Listed below are some often requested questions (FAQs) about shifting a dad or mum object with out shifting its little one objects in Unity:

Query 1: Why would I wish to transfer a dad or mum object with out shifting its little one objects?

Reply: There are a number of explanation why you may wish to transfer a dad or mum object with out shifting its little one objects. For instance, you may wish to:

  • Animate a dad or mum object independently of its little one objects.
  • Transfer a dad or mum object to a brand new location whereas preserving its little one objects in place.
  • Arrange objects within the scene hierarchy extra successfully.

Query 2: How do I transfer a dad or mum object with out shifting its little one objects?

Reply: You possibly can transfer a dad or mum object with out shifting its little one objects by following these steps:

  1. Choose the dad or mum object within the Hierarchy view.
  2. Within the Inspector view, find the Rework part.
  3. Click on on the small arrow subsequent to the Place property to broaden the property.
  4. Enter new values for the x, y, and z parts of the Place property.
  5. Be sure that the “Native” checkbox is chosen subsequent to the Place property.
  6. Click on on the Apply button to use the modifications.

Query 3: What’s the distinction between native house and world house?

Reply: Native house is the house that’s centered on the thing’s pivot level. The item’s place, rotation, and scale are outlined in native house. World house is the worldwide house of the scene. All objects within the scene exist in world house, and their positions, rotations, and scales are outlined in relation to one another.

Query 4: What’s the “Transfer with Youngsters” choice?

Reply: The “Transfer with Youngsters” choice is a button within the Rework menu that lets you transfer a dad or mum object and its little one objects collectively. When you choose the “Transfer with Youngsters” choice, the entire little one objects might be moved together with the dad or mum object, sustaining their relative positions.

Query 5: How can I arrange my sport objects extra successfully?

Reply: You possibly can arrange your sport objects extra successfully through the use of dad or mum objects to group associated objects collectively. It will make it simpler to pick, transfer, and manipulate the objects as a gaggle. It might probably additionally assist to enhance efficiency by permitting Unity to extra effectively render and replace the objects.

Query 6: Are there any greatest practices for shifting a dad or mum object with out shifting its little one objects?

Reply: Sure, there are a number of greatest practices that you would be able to observe when shifting a dad or mum object with out shifting its little one objects:

  • Use the “Transfer with Youngsters” choice to maneuver the dad or mum object and its little one objects collectively.
  • Use the “Native” checkbox to maneuver the dad or mum object in native house, somewhat than world house.
  • Use animation curves to regulate the motion of the dad or mum object over time, creating easy and cinematic animations.
  • Arrange your sport objects utilizing dad or mum objects to group associated objects collectively.

Closing Paragraph:

By understanding how you can transfer a dad or mum object with out shifting its little one objects, you possibly can improve your workflow and create extra advanced and interesting animations and interactions in Unity.

Along with the data supplied within the FAQ, listed here are some further ideas for shifting a dad or mum object with out shifting its little one objects in Unity:

Ideas

Listed below are some sensible ideas for shifting a dad or mum object with out shifting its little one objects in Unity:

Tip 1: Use keyboard shortcuts.

You should use the next keyboard shortcuts to shortly transfer a dad or mum object with out shifting its little one objects:

  • W: Transfer the thing ahead.
  • S: Transfer the thing backward.
  • A: Transfer the thing left.
  • D: Transfer the thing proper.
  • Q: Transfer the thing up.
  • E: Transfer the thing down.

Tip 2: Use the gizmos.

The gizmos are a set of visible instruments that can help you manipulate objects within the scene. To maneuver a dad or mum object with out shifting its little one objects utilizing the gizmos, merely click on and drag on the gizmo that corresponds to the axis you wish to transfer the thing alongside. For instance, to maneuver the thing ahead, click on and drag on the inexperienced arrow gizmo.

Tip 3: Use the Rework part.

You may as well transfer a dad or mum object with out shifting its little one objects through the use of the Rework part. To do that, choose the dad or mum object within the Hierarchy view, then find the Rework part within the Inspector view. You possibly can then enter new values for the x, y, and z parts of the Place property to maneuver the thing. Be sure that the “Native” checkbox is chosen subsequent to the Place property to maneuver the thing in native house, somewhat than world house.

Tip 4: Use animation curves.

Animation curves can help you management the motion of an object over time. You should use animation curves to create easy and cinematic animations of a dad or mum object shifting with out affecting its little one objects. To create an animation curve, choose the dad or mum object within the Hierarchy view, then click on on the “Animation” tab within the Toolbar. You possibly can then create a brand new animation curve by clicking on the “Add Curve” button.

Closing Paragraph:

By following the following tips, you possibly can successfully transfer dad or mum objects with out shifting their little one objects in Unity, enhancing your workflow and undertaking outcomes.

In conclusion, understanding how you can transfer a dad or mum object with out shifting its little one objects is a basic ability for working with parent-child relationships and creating advanced animations and interactions in Unity. By making use of the strategies and following the perfect practices mentioned on this article, you possibly can successfully manipulate objects in your scenes and obtain the specified outcomes in your tasks.

Conclusion

On this article, we explored the idea of shifting a dad or mum object with out shifting its little one objects in Unity. We mentioned the significance of parent-child relationships and the excellence between native and world house. We additionally supplied detailed steps on how you can transfer a dad or mum object with out shifting its little one objects, in addition to greatest practices and ideas for working with parent-child relationships in Unity.

By understanding and making use of the strategies mentioned on this article, you possibly can successfully manipulate objects in your scenes and create advanced animations and interactions. Listed below are some key takeaways to recollect:

  • Guardian-child relationships can help you arrange and manipulate objects in a hierarchical construction.
  • Native house is the house that’s centered on the thing’s pivot level, whereas world house is the worldwide house of the scene.
  • You possibly can transfer a dad or mum object with out shifting its little one objects by modifying the dad or mum’s Rework part in native house.
  • The “Transfer with Youngsters” choice lets you transfer a dad or mum object and its little one objects collectively, sustaining their relative positions.
  • Finest practices for shifting a dad or mum object with out shifting its little one objects embody utilizing the “Transfer with Youngsters” choice, utilizing the “Native” checkbox, and utilizing animation curves to regulate the motion of the dad or mum object over time.

掌握了移动父对象而不移动其子对象的技能,你就可以在 Unity 中有效地操作场景中的对象,并创建复杂的动画和交互,从而为你的项目实现预期的结果。

Finally, understanding how you can transfer a dad or mum object with out shifting its little one objects is a basic ability for working with parent-child relationships and creating advanced animations and interactions in Unity. By making use of the strategies and following the perfect practices mentioned on this article, you possibly can improve your workflow and obtain the specified outcomes in your tasks.