|
| 08 Jan 2017 07:45 AM |
so i made a script that gets the Cframe of a brick to travel a mode to it after that he gets the cframe of another brick to move to that one.
but there is something weird going on normally if the script runs to model need to move up but now he moves oblique down.
so added a print command to see the cframe he gets from that brick and here it become weird
if i check the cframe from the brick in the explorer it says :-28, 114.5, -9
but the output of the script is this:
-28.0006161, 100.476707, -9.00061893, 1, -0.000192349689, -5.78360305e-005, 0.000192364809, 1, 0.000261753681, 5.77856772e-005, -0.000261764799, 1
can someone help me please because i have no clue whats going on here is my script (its a part of my script the whole script is too big to understand but it is in this part where the problem is):
---------------------------------------------------------------------------------------- playern = script.Parent.Parent.Parent.name.Value -- get playername print(playern) local folder = game.Workspace:FindFirstChild(playern .. "2") -- get folder of player where data is stored local ship = folder.ship2 -- get the ship model in that folder local arealocation = folder.ship2.shipdata.arealocation.Value -- get location local location = folder.ship2.shipdata.location.Value -- get platform where ship is currently landed local keyframefinder = game.workspace:FindFirstChild("keyframes" .. arealocation) -- get folder from workspace print(keyframefinder) local key = keyframefinder:FindFirstChild(location) -- get folder where bricks are stored local key1 = key.key1 -- get first brick local move1 = key1.CFrame -- get first brick cframe local key2 = key.key2 -- get second brick local move2 = key2.CFrame -- get secondbricks cframe print(move1) -- this move the ship-
local initial = CFrame.new(-28, 105.5, -1) -- start location local final = move1 -- final location local ship = ship
for alpha = 0, 100, 1 do
ship:SetPrimaryPartCFrame(initial:lerp(final, alpha/100)) wait() end ---------------------
|
|
|
| Report Abuse |
|