#Part wont move correctly

1 messages · Page 1 of 1 (latest)

unkempt hawk
#

The PosPart says it moves to the correct location but it goes to the location of the pot in replicated storage.

hollow thicket
#

are you sure that what ever you are moving is inside the work space at the end of the code execution?

desert sphinx
#

dark mode pls

unkempt hawk
hollow thicket
hollow thicket
#

also before you change that I want you to use your original code again

#

this time I want you to click the plant using your select tool at the top and seeing where the primary part is

#

its possible its moving but the model isn't

#

and then use :PivotTo()

unkempt hawk
#

PosPart is the part. I had it so stage 1 becomes a child of the pot interacted with to make the position easier to find but no luck.

stone depotBOT
#

studio** You are now Level 3! **studio

unkempt hawk
#

Here is the output

#

says its moved to the right position but the model stays in the same area

#

here is a screenshot of output instead

hollow thicket
#

hmmm this is really strange,

#

check the pot to see if the plant clone is actually inside of it

unkempt hawk
hollow thicket
unkempt hawk
hollow thicket
#

can I get a video of you interacting with it?

unkempt hawk
#

yep lemme get my recording rq

unkempt hawk
#

the position where its going currently is the position the pot is in when i drag it out of replicatedstorage

hollow thicket
#

ohhhh so you manually take it out of replicated storage when you start the game?

#

ok thats a big hint

unkempt hawk
#

no no no

#

i mean like

hollow thicket
#

nvm mb

#

like you just automattically make the pots parented under workspace?

#

nooo noo

#

im sorry I got it

unkempt hawk
#

nw lol i appreciate you taking time to help

hollow thicket
unkempt hawk
#

how do i send that?

hollow thicket
#

actually dont do that I seen enough in the screen shot

unkempt hawk
#

the 2 screenshots are the full script

hollow thicket
#

ok I figured out your issue

#

target position is a vector 3 not a cframe

#

but you are using cframe to set it to the target position

#

which might be causing the problem

#

local targetPos = cloned PlantAnchor. CFrame + CFrame.new(0, cloned PlantAnchor.Size.Y / 2+ posPart.Size.Y/ 2, 0)

#

try that

unkempt hawk
#

alrighty

unkempt hawk
#

14:49:33.790 Workspace.Small Soiled Pot.Script:42: invalid argument #2 (Vector3 expected, got CFrame) - Server - Script:42

hollow thicket
#

which line is that? is it the one I changed or the one that actually changes the position itself

unkempt hawk
#

line you changed

hollow thicket
#

ok I think I know whats wrong

#

let me do something

unkempt hawk
#

thank you i appreciate it

hollow thicket
#

I got good news

#

this should fix it

#

I hope

#
local targetPos = CFrame.new(clonedPlantAnchor.Position.X, ((clonedPlantAnchor.Position.Y) + (cloned PlantAnchor.Size.Y / 2+ posPart.Size.Y/ 2)), clonedPlantAnchor.Position.Z) ```
unkempt hawk
#

clone:SetPrimaryPartCFrame(CFrame.new(targetPos))

#

15:06:19.679 Workspace.Small Soiled Pot.Script:46: invalid argument #1 to 'new' (Vector3 expected, got CFrame) - Server - Script:46

hollow thicket
#

try :PivotTo()

#

clone:PivotTo(targetPos)

unkempt hawk
#

alright

stone depotBOT
#

studio** You are now Level 4! **studio

unkempt hawk
hollow thicket
#

whaaa???

#

lol sometimes scripting can be a pain

unkempt hawk
hollow thicket
#

ok maybe try this before you move it, parent it to the workspace and after its moved parent it to the pot

unkempt hawk
#

Only reason I parented to pot was so it could find the PlantAnchor in the pot easier

#

tried it in workspace before that and no luck

hollow thicket
#

well its just a part so here is an idea just set the part cframe directly

#

instead of using primary part

#

Clone.CFrame = targetPos

unkempt hawk
#

lemme try rq

unkempt hawk
#

i also tried Clone.PosPart.Cframe and got the same thing

hollow thicket
#

clone shouldnt be a model it should be a part?

#

ohhhhhhhhhhhhhhh

#

I see,

#

ngl sorry I was confused I thought you were just moving the part not an entire model

unkempt hawk
hollow thicket
#

yeah then the cframe part wont work scrap that idea

unkempt hawk
#

alr

hollow thicket
#

clone.PrimaryPart:PivotTo(targetPos)

#

maybe that will fix it

unkempt hawk
#

ill try

unkempt hawk
hollow thicket
unkempt hawk
#

should i try redoing the stage 1 and delete original?

hollow thicket
#

nahh

#

what if you refrence the part you want to move specifically

#

and then just move that

unkempt hawk
#

thats what i was doing when i did clone.PosPart

hollow thicket
#

I dont see that line in your script screen shots

#

and you shouldnt clone the part anyways

unkempt hawk
hollow thicket
unkempt hawk
hollow thicket
#

oh sorry I think im dyslexic sometimes

#

i mistaked "." for ":" sorry

#

which dosent even make sense

unkempt hawk
unkempt hawk
hollow thicket
#

nooo im sorrry

unkempt hawk
unkempt hawk
#

If u can jus lmk what u think

#

It looks like for whatever reason the plantanchor is moving to the PosPart