generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

get wrong CFrame from brick

Previous Thread :: Next Thread 
yentedolfijn is not online. yentedolfijn
Joined: 16 Apr 2014
Total Posts: 276
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image