今日作った2段ジャンプ・ワープ・チェックポイントを組み合わせて、自分だけのステージを仕上げましょう。余裕がある人は、以下のアイデアにも挑戦してみてください。
チェックポイントとワープを組み合わせて、ちょっと変わったショートカットのあるステージにしてみたよ!
今日作った2段ジャンプ・ワープ・チェックポイントを組み合わせて、自分だけのステージを仕上げましょう。余裕がある人は、以下のアイデアにも挑戦してみてください。
🧗 壁ジャンプ
2段ジャンプと似た考え方で、壁に触れている間だけジャンプできるようにする応用です。
⚔️ 攻撃できる剣
ツール型アイテム(第4回)とHumanoid.Health(第9回)の組み合わせで作れます。
🚗 車を運転できるようにする
ツールボックスの「 乗り物 」カテゴリから車を出すだけで、最初から運転できる状態のものが手に入ります。
球体パーツを1つ作り、名前を「 追跡NPC 」にして「 固定 」もしておきましょう。Scriptを入れて、以下のコードを貼り付けると、近づいた時だけゆっくりプレイヤーを追いかけてきます。
local ball = script.Parent
local speed = 2 -- 追いかける速さ
local detectRange = 30 -- 反応する距離
game:GetService("RunService").Heartbeat:Connect(function()
for _, player in pairs(game.Players:GetPlayers()) do
local character = player.Character
if character and character:FindFirstChild("HumanoidRootPart") then
local target = character.HumanoidRootPart
local distance = (target.Position - ball.Position).Magnitude
if distance <= detectRange then
local direction = (target.Position - ball.Position)
direction = Vector3.new(direction.X, 0, direction.Z).Unit
ball.Position = ball.Position + direction * speed * (1/60)
end
end
end
end)
チェックポイントとワープを組み合わせて、ちょっと変わったショートカットのあるステージにしてみたよ!
Well done!
次のステップに進みましょう!