Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I use CFrame to move my sphere for a working gun but it doesnt work??

Asked by 5 years ago
Edited 5 years ago

https://gyazo.com/d0d2004eaab5b0506895ce61f18ce402

So I tried to use CFrame to move a sphere bullet but it claims that CFrame is not a valid member of special mesh, so the bullet doesnt move when I click. What can I use other than CFrame to move the sphere bullet or do i have to rearrange the wording?

0
SpecialMesh isn't a part. Only objects that inherit BasePart have the 'Position' property. SpecialMesh is not a BasePart. You probably want to be moving the part that's outside of the SpecialMesh instead. pidgey 548 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

As what pidgey answered, SpecialMesh is not a BasePart, therefore CFrame is not a valid property for it. You may want to use a normal Part with Shape property being set to Enum.PartType.Ball, or use a part with a SpecialMesh instance as a child instead.

1.

local part = Instance.new("Part")
part.Shape = Enum.PartType.Ball --Turns the part into a spherical object

part.CFrame = CFrame.new(startpos, endpos)
--Extra content goes here

2.

local part = Instance.new("Part")
local specialMesh = Instance.new("SpecialMesh", part)

specialMesh.MeshType = Enum.MeshType.Sphere --As you did
--Now the part should be roundy.
part.CFrame = CFrame.new(startpos, endpos)
--Extra content goes here oof
0
since when did pidgey can speak english tho- nvm i luv pokemons Afterl1ght 321 — 5y
1
https://gyazo.com/e2f4474df4681e18edf5c6d2cb627cda Thank you so much!!!!! You helped me and thats what it looks like now :D iinaoriku 52 — 5y
Ad

Answer this question