Guide:Parenting

From Project Arrhythmia Wiki
Jump to navigation Jump to search
The parenting menu in the legacy editor

Parenting is a feature of the editor that allows objects to inherit properties of other objects. When an object is parented to another object, it will treat the original object as the origin point, and always move relative to the object.

To parent one object to another, select the magnifying glass icon in the parenting section of the Object Editor. This will bring up a searchable list of every object in the level. Once you click the name of an object, it will be set as the parent.

Types of parenting

There are three types of parenting available, Position, Scale, and Rotation. Each can be toggled in the object menu, and Position and Scale are enabled by default. Additional parenting settings can be accessed by clicking the [v] arrow icon in the 'parent object' section of the object editor.

  • Position: The object will treat the position of its parent as the origin, and will add its own position to its parent. A position parented object with position (20,20) with a parent at (10,5) will appear at the position (30,25).
  • Rotation: The object will add its own rotation to its parent. An object with rotation 30 and a parent with rotation 60 will be rotated 90 degrees. If the object has a different position than its parent, then the object will treat its parent's center as the axis of rotation instead of it's own center.
  • Scale: The object will change size relative to its parent. Unlike position and rotation, scale parenting is multiplicative instead of additive, so an object of size (5,10) with a scale parent of size (2,2) will appear as (10,20). Scale parenting also multiplies the child object's position away from the parent.

Parenting Offset

Parenting offset is a feature of parenting that offsets the movement of objects from their parents in time. Instead of being parented to the current time, an object will be parented to where the parent was some time ago, measured in seconds. Position, Rotation, and Scale can each be offset individually. An object with a position offset of 1 will be parented to the where it's parent was 1 second ago. Clicking the < > arrows in the parenting offset menu will change the offset by +-0.1 seconds and the << >> arrows change the time by +-1 second.

Uses of parenting

  • Bullets:

Bullets, and any other moving projectiles, are created using parenting. To create a bullet, create an empty object and set its position to where the bullet will start. This will be the bullet's origin. Create another object that moves from (0,0) in a straight line. Parent that object to the origin object with position and rotation parenting. By copy and pasting both objects and moving or rotating the origin, the bullet can start from different points and move in different angles.

  • Bosses:

Parents are essential for creating bosses, as they are too complex for every object to individually move. To create a boss, create an empty object with (1,1) scale and parent every part of the boss's body to it with position, rotation, and scale parenting enabled. Only use keyframes on this 'base' object to move the boss. To have separate parts still attached to the body, like a face or hands, do the previous steps using an object parented to the base as a base.

  • Detailed Objects:

Parents can also be used to create detailed static elements of the level that can be copy and pasted. Create a similar base object that you would for a boss, then have the details be parented to it. This object can now be copy and pasted with the initial keyframes of the parent object changed.

  • Curved movement:

Normally, objects in the editor can only move in straight lines. Since parenting allows objects to move relative to each other, they can be used to create curved movement. For example, if you have a parent moving linear in the x direction, and a child moving outsine in the y direction, the child will move in an arc upwards.

Alpha features/Changes

These features of parenting are only available on the Alpha branch of the editor, and will eventually be available in all versions of the game once the alpha editor is complete.

  • Dropper: Clicking the dropper icon in the object editor will allow you to select an object from the object timeline instead of the parenting menu.
  • Camera Parenting: The camera icon in the object editor lets an object be parented to the camera. The object will treat the center of the camera as an object that it is parented to.
  • Parenting Menu: The parenting menu has been rearranged. The parenting options have different icons, and the parenting offset is no longer a dropdown menu.
Guides
Editor Basics First steps • Song VerificationCreating an objectKeyframingParentingRandomization • Prefabs • Uploading a level • Creating a collection
Editor Skills Creating characters • Animation techniques • Creating gameplay • Brainstorming ideas • Choosing a song • Telling a story
Technical Text formatting • Sharing level assets • Changing level audio