Good afternoon developers!
So I’m trying to create a plane crash sequence, similar to the ones in other plane crash survival games(Like Plane Crash or Survive Flight 817), and to be honest I’m a bit lost.
I don’t need or want anyone to give me the full script, but I would really appreciate some advice on how to go about programming something like this properly.
1 Like
I have Not writebyou a füll Script but a explanation How IT could Work:
A Part named Flight100
(the airplane Part Name)
Fly 60 secounds straight Forward, after 60 secounds IT rotate 45° down and “Crash”
(If you want i can also add that the plane welds get destroyed and the anchoring get unanchored after the plane Crash, and every Part in the model Flight100
get on fire, für den splitterefect beim Aufprall des flugzeugs)
I also write you some notes in to the Script so you undersand it better, i Hope IT help’s :
-- Reference to the part
local part = game.Workspace.Flight100
-- Initial movement speed and direction
local speed = 10 -- The speed at which the part moves forward
local moveTime = 60 -- Time in seconds before rotation occurs
-- Function to move the part forward
local function moveForward()
while moveTime > 0 do
-- Move the part forward in the direction it is currently facing
part.CFrame = part.CFrame * CFrame.new(0, 0, -speed * wait())
moveTime = moveTime - wait() -- Countdown until rotation
end
end
-- Function to rotate the part downward and move in the new direction
local function rotateAndMoveDownward()
-- Rotate the part 45 degrees downward (in local space)
part.CFrame = part.CFrame * CFrame.Angles(math.rad(45), 0, 0)
-- Move the part forward in the new downward direction
while true do
-- Continue moving in the new direction
part.CFrame = part.CFrame * CFrame.new(0, 0, -speed * wait())
end
end
-- Start the initial forward movement
moveForward()
-- After 60 seconds, rotate and move downward
rotateAndMoveDownward()
Good night
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.