How To Move Model's Position

Hello, I was working on a commission for a game, and I ran into an issue.

I have a model with more than one part, and I’m not sure how to change the position of the model after a certain part of a script.

  • I tried making the parts transparent, and then making them reappear

  • I tried moving the model’s primary part to the position (but it said

X cannot be assigned to

)

Here’s my script:

local fader = script.Parent.Parent.fade
local monster = game.Workspace["Cave Dweller"]
local sniff = game.Workspace.Sniff
local step = game.Workspace.Loud_Step
local creak = game.Workspace["Wood Door Creak Squeak 2 (SFX)"]

task.wait(2.5)

local function typewrite(object,text,length)
	for i = 1,#text,1 do
		local sound = Instance.new("Sound")
		sound.Parent = game.Workspace
		sound.SoundId = "rbxassetid://9120300060"
		sound.Name = "DialogSound"
		sound:Play()
		object.Text = string.sub(text,1,i)
wait(length)		
	end
	for i,v in pairs(game.Workspace:GetChildren()) do
		if v.Name == "DialogSound" then
			v:Destroy()
		end
	end
end

typewrite(script.Parent, "Welcome to your new job.") 
task.wait(4.5)
script.Parent.TextTransparency = 0.1
task.wait(0.1)
script.Parent.TextTransparency = 0.2
task.wait(0.1)
script.Parent.TextTransparency = 0.3
task.wait(0.1)
script.Parent.TextTransparency = 0.4
task.wait(0.1)
script.Parent.TextTransparency = 0.5
task.wait(0.1)
script.Parent.TextTransparency = 0.6
task.wait(0.1)
script.Parent.TextTransparency = 0.7
task.wait(0.1)
script.Parent.TextTransparency = 0.8
task.wait(0.1)
script.Parent.TextTransparency = 0.9
task.wait(0.1)
script.Parent.TextTransparency = 1
task.wait(0.1)
wait(1.5)
script.Parent.TextTransparency = 0
typewrite(script.Parent, "Let's wait for your new friend to arrive.")
task.wait(1)
task.wait(2.5)
script.Parent.TextTransparency = 0.1
task.wait(0.1)
script.Parent.TextTransparency = 0.2
task.wait(0.1)
script.Parent.TextTransparency = 0.3
task.wait(0.1)
script.Parent.TextTransparency = 0.4
task.wait(0.1)
script.Parent.TextTransparency = 0.5
task.wait(0.1)
script.Parent.TextTransparency = 0.6
task.wait(0.1)
script.Parent.TextTransparency = 0.7
task.wait(0.1)
script.Parent.TextTransparency = 0.8
task.wait(0.1)
script.Parent.TextTransparency = 0.9
task.wait(0.1)
script.Parent.TextTransparency = 1
wait(0.5)
fader.BackgroundTransparency = 0.9
	task.wait(0.1)
fader.BackgroundTransparency = 0.8
	task.wait(0.1)
fader.BackgroundTransparency = 0.7
	task.wait(0.1)
fader.BackgroundTransparency = 0.6
	task.wait(0.1)
fader.BackgroundTransparency = 0.5
	task.wait(0.1)
fader.BackgroundTransparency = 0.4
	task.wait(0.1)
fader.BackgroundTransparency = 0.3
	task.wait(0.1)
fader.BackgroundTransparency = 0.2
	task.wait(0.1)
fader.BackgroundTransparency = 0.1
	task.wait(0.1)
fader.BackgroundTransparency = 0
task.wait(0.1)

if fader.BackgroundTransparency == 0 then
	task.wait(2)
	creak:Play()
	wait(2)
	step:Play()
	wait(1.3)
	step:Play()
	wait(1.7)
	step:Play()
	wait(3)
	sniff:Play()
	wait(2)
	script.Parent.TextTransparency = 0
	typewrite(script.Parent, "He's here...")
	task.wait(4.5)
	script.Parent.TextTransparency = 0.1
	task.wait(0.1)
	script.Parent.TextTransparency = 0.2
	task.wait(0.1)
	script.Parent.TextTransparency = 0.3
	task.wait(0.1)
	script.Parent.TextTransparency = 0.4
	task.wait(0.1)
	script.Parent.TextTransparency = 0.5
	task.wait(0.1)
	script.Parent.TextTransparency = 0.6
	task.wait(0.1)
	script.Parent.TextTransparency = 0.7
	task.wait(0.1)
	script.Parent.TextTransparency = 0.8
	task.wait(0.1)
	script.Parent.TextTransparency = 0.9
	task.wait(0.1)
	script.Parent.TextTransparency = 1
	wait(1)
--make cave person appear
	wait(0.6)
	fader.BackgroundTransparency = 0.1
	wait(0.1)
	fader.BackgroundTransparency = 0.2
	wait(0.1)
	fader.BackgroundTransparency = 0.3
	wait(0.1)
	fader.BackgroundTransparency = 0.4
	wait(0.1)
	fader.BackgroundTransparency = 0.5
	wait(0.1)
	fader.BackgroundTransparency = 0.6
	wait(0.1)
	fader.BackgroundTransparency = 0.7
	wait(0.1)
	fader.BackgroundTransparency = 0.8
	wait(0.1)
	fader.BackgroundTransparency = 0.9
	wait(0.1)
	fader.BackgroundTransparency = 1
end



Where it says (–make cave person appear) is where I want to put the solution script someone might provide.)

(And yes, I am VERY aware there is an easier way of doing

Transparency = 0.1
	wait(0.1)
Transparency = 0.2
	wait(0.1)
Transparency = 0.3
	wait(0.1)
Transparency = 0.4
	wait(0.1)
Transparency = 0.5
	wait(0.1)
Transparency = 0.6
	wait(0.1)
Transparency = 0.7
	wait(0.1)
Transparency = 0.8
	wait(0.1)
Transparency = 0.9
	wait(0.1)
Transparency = 1

)

Thanks in advance, -8ntlers

2 Likes

Whenever I see something like this it kills me. JUst use a for loop. It’s way more professional than this.

2 Likes

For moving a model from a place to another, you can use the :MoveTo(Vector3) function or use the TweenService

You could also use model:SetPrimaryPartCFrame(), but use :MoveTo() better, because the model:SetPrimaryPartCFrame() sets the model Position AND Orientation so yeah keep that in mind.

2 Likes

Or just actually move the model :skull:

1 Like

I stated why I do it that way, but thank you so much anyway! Have an amazing day!

Thank you so much! I’ll do that right now!

1 Like

Try moving the model’s Origin Position. That sounds like the problem. (is this solved already, lol?)

1 Like

i guess it automatically removed my answer cuz i edited it lol

1 Like

ever better, use TWEENS! Never need to do those wait, and slowly increment the transparency by 0.1.

edit: like Paco said, MoveTo() should work

2 Likes

i said MoveTo() first cuz i thought that he wasnt trying to do a cool transition, but yeah TweenService works too on these cases

2 Likes
typewrite(script.Parent, "Welcome to your new job.")
task.wait(4.5)
game:GetService("TweenService"):Create(script.Parent, TweenInfo.new(1), {TextTransparency = 1}):Play()
task.wait(1.5)
game:GetService("TweenService"):Create(script.Parent, TweenInfo.new(0.2), {TextTransparency = 0}):Play()
typewrite(script.Parent, "Let's wait for your new friend to arrive.")
task.wait(3.5)
game:GetService("TweenService"):Create(script.Parent, TweenInfo.new(1), {TextTransparency = 1}):Play()

I tried to rewrite the amount of waits and task.wait() but there were too much but anyways you should use :MoveTo(position: Vector3?)

1 Like

Instead of SetPrimaryPartCFrame, it would be better to use :PivotTo(CFrame). It’s the same thing but I believe :PivotTois more updated then SetPrimaryPartCFrame.

1 Like

Deprecated. And it’s PivotTo() not SetPivot()??

1 Like

Dam :skull: i keep using that one oof

1 Like

Got the names wrong, my apologies.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.