概要
robloxでassistantやってみた。
練習問題やってみた。
練習問題
CylindricalConstraintを、使え。
手順
- ServerScriptServiceに、scriptを追加。
- スクリプトを書く。
local part1 = Instance.new("Part", workspace)
part1.Anchored = true
part1.Size = Vector3.new(1, 2, 2)
part1.CFrame = CFrame.new(-0.513, 8.763, 10) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-45))
part1.Name = "Anchor"
local part2 = Instance.new("Part", workspace)
part2.Anchored = false
part2.Shape = Enum.PartType.Cylinder
part2.Size = Vector3.new(1, 3, 3)
part2.CFrame = CFrame.new(-2.987, 11.237, 10.25) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-45))
local cylindricalConstraint = Instance.new("CylindricalConstraint", part1)
local attachment0 = Instance.new("Attachment", part1)
local attachment1 = Instance.new("Attachment", part2)
attachment0.Position = Vector3.new(-0.5, 0, 0)
attachment0.Axis = Vector3.new(-1, 0, 0)
attachment1.Position = Vector3.new(0.5, 0, 0)
attachment1.Axis = Vector3.new(-1, 0, 0)
cylindricalConstraint.Attachment0 = attachment0
cylindricalConstraint.Attachment1 = attachment1
cylindricalConstraint.LimitsEnabled = true
cylindricalConstraint.Restitution = 1
写真
以上。