|
| 06 Sep 2015 01:04 AM |
| I have a brick placed, the brick spawns a model and uses :MoveTo() to get it to it, the problem is that the model is suppose to be merged into the brick and I can't figure out how (Tried Vector3 and CFrame). Any idea how? |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2015 01:08 AM |
If you want the model to merge with the brick you can either use model:SetPrimaryPartCFrame() or:
model:MoveTo(targetPos) model:TranslateBy(0, targetPos.Y - model:GetModelCFrame().Y, 0) |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2015 01:22 AM |
Script looks like this:
game.Workspace:WaitForChild(game.Players.LocalPlayer.Name)
local house = game.ReplicatedStorage.House1:Clone() house.Parent = workspace house:MoveTo(game.Workspace.HouseSpawns.HouseSpawnLocation1.Position) house:TranslateBy(0, game.Workspace.HouseSpawns.HouseSpawnLocation1.Position.Y - house:GetModelCFrame().Y, 0)
getting the error of:
18:20:47.842 - Unable to cast double to Vector3 18:20:47.843 - Script 'Players.Player.Backpack.HouseTest', Line 6 18:20:47.843 - Stack End |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2015 11:28 AM |
oops, my bad:
model:TranslateBy(Vector3.new(0, targetPos.Y - model:GetModelCFrame().Y, 0)) |
|
|
| Report Abuse |
|
|