Transform Component: Difference between revisions

From Pummel Party Mod Documentation
Jump to navigation Jump to search
RBDev (talk | contribs)
No edit summary
Added section on limits
 
(11 intermediate revisions by one other user not shown)
Line 1: Line 1:
The Transform Component is the base component of all GameObjects in a mod.  
[[File:TransformComponentExample.gif|thumb|right|600px|Notice how the transform values change when the object is moved, rotated and scaled.]]
 
The Transform Component is the base component of every [[Gameobject]] in a mod. It defines the position, orientation and scale of the gameobject. These values are relative to the parent gameobject in the hierarchy, or from the world origin if the gameobject doesn't have a parent.


== Component Settings ==
== Component Settings ==
Line 7: Line 7:
! Property !! Description
! Property !! Description
|-
|-
|'''Type''' || The shape of the light.
|'''Position''' || The position of the GameObject relative to its parent. The three values from left to right represent a position on the x-axis, y-axis and z-axis respectively.
|-
| style="padding-left: 2em;" | ''Point'' || Like a light bulb, shines light out in all directions from a single point.
|-
| style="padding-left: 2em;" | ''Spot'' || Shaped like a spot light, projecting light from a single point out in a cone shape.
|-
| style="padding-left: 2em;" | ''Directional'' || Similar to the sun, shines light from a given direction.
|-
| '''Color''' || The color of the shading applied by the light source.
|-
| '''Range''' || The distance the light source will effect objects (for directional lights this has no effect).
|-
| '''Intensity''' || The brightness of the light source.
|-
| '''Shadows''' || Determines if this light source will cast shadows and whether they will have a soft or hard edge).
|-
| style="padding-left: 2em;" | ''None'' || Light does not produce shadows.
|-
|-
| style="padding-left: 2em;" | ''Hard'' || Light produces shadows with hard, crisp edges.
| '''Rotation''' || The rotation of the GameObject relative to its parent. The three values from left to right represent a rotation around the x-axis, y-axis and z-axis respectively. These values are in degrees.
|-
|-
| style="padding-left: 2em;" | ''Soft'' || Light produces shadows with soft, blurred edges.
| '''Scale''' || The relative scale of the GameObject. The three values from left to right represent relative scaling along the GameObject's x-axis, y-axis and z-axis respectively.
|}
|}


== Example ==
==Limits==
Let's say for example we have the following scene containing a prop of a camp fire. In order to show the camp fire is lit we might add a light source.
* The position of a transform cannot be greater than 1000 units along any axis in any direction.
 
* Scale cannot be 0 or negative, and cannot be greater than 1000x.
[[File:light_ex_01.jpg|frame|none]]
 
==== Adding a light source to our scene ====
# Right click on the camp fire in the hierarchy window on the left side of the mod editor screen.
# In the context menu that opens move your mouse to 'Light'.
# Click on 'Point Light' from the options of lights.
# You should now have a light source under your camp fire, click on the lights gizmo icon and move the light slightly up.
# While selecting the light game object, look in the inspector window on the right side of the mod editor.
# Find the 'Color' option and change it to orange.
 
We now have a light source under our campfire that makes it appear lit.
[[File:light_ex_02.jpg|frame|none]]
 
 
{{Component Navbox}}


[[Category:Rendering Components]]
[[Category:Components]]
[[Category:Components]]

Latest revision as of 02:04, 16 December 2022

Notice how the transform values change when the object is moved, rotated and scaled.

The Transform Component is the base component of every Gameobject in a mod. It defines the position, orientation and scale of the gameobject. These values are relative to the parent gameobject in the hierarchy, or from the world origin if the gameobject doesn't have a parent.

Component Settings

Property Description
Position The position of the GameObject relative to its parent. The three values from left to right represent a position on the x-axis, y-axis and z-axis respectively.
Rotation The rotation of the GameObject relative to its parent. The three values from left to right represent a rotation around the x-axis, y-axis and z-axis respectively. These values are in degrees.
Scale The relative scale of the GameObject. The three values from left to right represent relative scaling along the GameObject's x-axis, y-axis and z-axis respectively.

Limits

  • The position of a transform cannot be greater than 1000 units along any axis in any direction.
  • Scale cannot be 0 or negative, and cannot be greater than 1000x.