BasePart

BasePart : PVInstance

Overview

Properties

CFrame

CFrame

The provided text describes the role and usage of a property named "CFrame" in various game development contexts. CFrame is typically stored as an instance of CFrame data type and represents a transformation matrix that combines position, orientation (rotation), and scale information for manipulating and transforming 3D objects within a scene. It helps define the position and orientation of game objects in relation to their parent's reference system and can be replicated across multiple clients or servers to ensure consistent object positions during multiplayer games. The CFrame property is accessible via

Code Samples

local Part = script.Parent

-- Position
Part.CFrame = CFrame.new(200, 50, 300)

-- Angle
local Rotation = CFrame.Angles(0, 0, 30)
Part.CFrame = Part.CFrame * Rotation

-- Position & Angle
Part.CFrame = CFrame.new(200, 50, 300) * CFrame.Angles(0, 40, 0)

-- LookAt
local TargetPosition = Vector3.new(0, 30, 0)
Part.CFrame = CFrame.lookAt(Part.Position, TargetPosition)

Anchored

bool

The given input appears to be a collection of AI responses about the Anchored property in the context of various game engine and programming scenarios. This property is commonly found in classes that represent game objects, such as BasePart. The Anchored property typically has two states: true and false, which determine if an object or component remains fixed to a specific position within its parent's coordinate system or can move freely within the game environment. In some cases, it impacts collision detection and physics interactions between objects. Accessing and modifying this property is often done through

Code Samples

local Part = script.Parent

Part.Anchored = false

CanCollide

bool

The provided text describes the CanCollide property in various contexts, mainly within game engines or simulation platforms. It is typically a boolean value that determines whether an object (e.g., BasePart, part, functional component) can collide with other objects or not. When set to true, it enables collision detection and interaction between this object and others in the environment. Conversely, when set to false, it disregards any incoming collision events and allows the object to pass through others as if it had no physical presence. This property is managed by getter/setter methods and can be useful for creating specific gameplay mechanics

Code Samples

local Part = script.Parent

Part.CanCollide = false

CanQuery

bool

Currently not supported.

Code Samples

CanTouch

bool

The given text discusses the "CanTouch" property, which is a boolean value typically found in game development or simulation environments. This property can be implemented in various programming languages and frameworks such as C++, Unreal Engine, and Lua. In general, it determines whether an object (e.g., base part or actor) within the simulated environment can receive touch events from other objects or players.

Code Samples

local Part = script.Parent

local function OnTouched(otherPart)
    print(Part.Name, "Touched :", otherPart.Name)
end
Part.Touched:Connect(OnTouched)

Part.CanTouch = false

Size

Vector3

The "Size" property represents the dimensions of a 3D object in the game world, using the Vector3 data type. This property defines the width, height, and depth of the object and is typically adjustable to resize or scale the object. Changes to the "Size" property impact the physical presence of the object within the game environment, including its collision bounds and alignment.

Code Samples

local Part = script.Parent

Part.Size = Vector3.new(50, 50, 50)

AssemblyAngularVelocity

Vector3

Currently not supported.

Code Samples

AssemblyCenterOfMass

Vector3

Currently not supported.

Code Samples

AssemblyLinearVelocity

Vector3

The "AssemblyLinearVelocity" property is a Vector3 value that specifies the overall linear velocity of an assembly. This includes the combined movement of all interconnected parts within the assembly.

Code Samples

local Part = script.Parent

print(Part.AssemblyLinearVelocity)

AssemblyMass

number

Currently not supported.

Code Samples

BrickColor

BrickColor

The "BrickColor" property is a string that represents the color of a BasePart using a predefined palette of colors specific to the game engine. It allows developers to quickly set or retrieve an object's color by selecting from the available options in the palette. This property is particularly useful for ensuring visual consistency and easy customization within the game environment.

Code Samples

local Part = script.Parent

Part.BrickColor = BrickColor.new("Really red")

if Part.BrickColor.Name == "Really red" then
    print("Red!")
end

CastShadow

bool

The "CastShadow" property determines whether the object casts a shadow in the game environment. It is a boolean value where true allows the object to cast shadows, and false disables shadow casting. This property is useful for optimizing performance or achieving specific visual effects in the game.

Code Samples

local Part = script.Parent

print(Part.CastShadow)

CenterOfMass

Vector3

Currently not supported.

Code Samples

CollisionGroup

string

The "CollisionGroup" property is a string value that determines the collision group to which the part belongs. Collision groups are used to define custom collision behaviors between different groups of parts in a game or simulation environment. By assigning parts to specific collision groups and configuring group interactions, developers can control which parts can collide with each other. This property is particularly useful for creating advanced gameplay mechanics and optimizing collision checks in complex scenes.

Code Samples

local Part = script.Parent

local PhysicsService = game:GetService("PhysicsService")

local DefaultGroup = "Default"
local FallGroup = "Fall"
PhysicsService:RegisterCollisionGroup(FallGroup)

wait(2)
PhysicsService:CollisionGroupSetCollidable(DefaultGroup, FallGroup, false)

Part.CollisionGroup = FallGroup

Color

Color3

The "Color" property is a Color3 value that provides more granular control over the object's color. Unlike "BrickColor,"this property allows for precise RGB color definition, enabling developers to create a broader range of colors. It is useful for detailed visual customization and creating specific aesthetics.

Code Samples

local Part = script.Parent

wait(2)
Part.Color = Color3.new(0, 0, 1) -- Blue

wait(2)
Part.Color = Color3.fromRGB(255, 0, 0) -- Red

CurrentPhysicalProperties

PhysicalProperties

Currently not supported.

Code Samples

CustomPhysicalProperties

PhysicalProperties

Currently not supported.

Code Samples

ExtentsCFrame

CFrame

Currently not supported.

Code Samples

ExtentsSize

Vector3

Currently not supported.

Code Samples

LocalTransparencyModifier

number

Currently not supported.

Code Samples

Locked

bool

bool

The "Locked" property is a boolean value that specifies whether a part can be edited in the studio or during runtime. When set to true, the part is locked and cannot be moved, resized, or otherwise modified by the user. This property is useful for safeguarding specific parts of the game environment from accidental changes during development or gameplay.

Code Samples

local Part = script.Parent

print(Part.Locked)

CanClimb

bool

Determines whether the character can climb the designated part. If CanClimb is set to true, the player character will transition to the Climbing state upon contact.

Code Samples

Mass

number

Currently not supported.

Code Samples

Massless

bool

Currently not supported.

Code Samples

Material

Enum.Material

The "Material" property is an enumeration value that defines the physical and visual characteristics of a part's surface, such as friction, elasticity, and texture. This property offers a variety of predefined materials, enabling developers to achieve specific aesthetics and physics behaviors.

Code Samples

local Part = script.Parent

Part.Material = Enum.Material.StoneBrick

MaterialVariant

string

The "MaterialVariant" property is a string value that specifies a variant of the predefined material applied to a part. It provides additional customization options for altering the appearance and behavior of an object's surface.

Code Samples

local Part = script.Parent

print(Part.MaterialVariant)

Position

Vector3

Code Samples

local Part = script.Parent

Part.Position = Vector3.new(0, 50, -500)

ReceiveAge

number

Currently not supported.

Code Samples

Reflectance

number

Currently not supported.

Code Samples

ResizeIncrement

number

Currently not supported.

Code Samples

RootPriority

number

Currently not supported.

Code Samples

Rotation

Vector3

Currently not supported.

Code Samples

Orientation

Vector3

Code Samples

local Part = script.Parent

Part.Orientation = Vector3.new(45, 0, 0)

Transparency

number

The "Transparency" property is a numeric value that determines the visibility of a part. Its value ranges from 0 (fully visible) to 1 (completely transparent), allowing developers to hide or fade parts for various gameplay or visual effects.

Code Samples

local Part = script.Parent

Part.Transparency = 0.5

Methods

ApplyImpulse

The ApplyImpulse method applies an impulse to a physics object, causing it to move or rotate based on the force and direction of the impulse.

Parameters

Vector3 impulse

Return

void

Code Samples

local Part = script.Parent

local Force = Vector3.new(0, 0, -200000)

wait(2)
Part.Anchored = false
Part:ApplyImpulse(Force)

GetMass

Currently not supported.

Parameters

Return

number

Code Samples

Events

TouchEnded

The TouchEnded event is triggered when a touch input ends or is lifted off a part. This event is primarily used for touch-based interactions, enabling developers to detect when a user stops touching an object within the game environment.

Parameters

BasePart otherPart

Code Samples

local Part = script.Parent

local function OnTouchEnded(otherPart)
    print("[OnTouchEnded]", otherPart)
end
Part.TouchEnded:Connect(OnTouchEnded)

Touched

The Touched event is triggered when another object comes into contact with the part. This event is commonly used in game development to detect collisions or interactions between objects, enabling developers to implement custom behaviors or reactions when a part is touched by another object.

Parameters

BasePart otherPart

Code Samples

local Part = script.Parent

local function OnTouched(otherPart)
    print("[OnTouched]", otherPart)
end
Part.Touched:Connect(OnTouched)

Last updated