#Is there a proper way to assign vector3 position and rotation?

1 messages · Page 1 of 1 (latest)

tall mural
#

you can use cframe

lapis badge
#

imma try tht rq

ionic sphinxBOT
#

studio** You are now Level 1! **studio

lapis badge
#

hol on

charred sequoia
#

but they are super necisarry

lapis badge
charred sequoia
#

also generally i’d reccomend CFrame.fromOrientation instead of CFrame.Angles

#

fromOrientation usually gets it more accurate

neat sinew
#

i think

#

you need to set the whole cframe

lapis badge
#

ts shit is getting more complicated with each second 🙏

tall mural
#

depends if it is model you cn use pivot to

#

but cframe you have to construct a new value and cannot set the cframe to a specific locked position

charred sequoia
#

let me give an example for cframe

#

lets say you want to set a Position of 0,10,0 and a Rotation of 90,90,0

#

i assume you know how to do that with Vector3

#

in CFrame it would be

#

part.CFrame = CFrame.new(0,10,0) * CFrame.fromOrientation(math.rad(90),math.rad(90),0)

lapis badge
#

now it just spawns in place where its located in replicated storage

agile lagoon
# lapis badge

you can't just change the Position property of a CFrame directly (like part.CFrame.Position = ...). You have to create a whole new CFrame.

ionic sphinxBOT
#

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

agile lagoon
#

just do "object.CFrame = CFrame.new(newVector)"

#

or "object.CFrame = CFrame.new(newVector) * object.CFrame.Rotation"

lapis badge
agile lagoon
#

the problem is more likely from your full script not the pos thing

#

if you set the CFrame not in a loop it wont follow you

#

but if you did it will

#

and if the object is anchored it might fail, and refuse to update