generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Quote "Position is not a valid member of Model"

Previous Thread :: Next Thread 
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
16 Aug 2016 09:14 PM
^^Unquote, Output
I have a mouseclicker in a part to make it move once clicked, but output reads, "Position is not a valid member of Model".
Report Abuse
killerbot29003 is online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
16 Aug 2016 09:18 PM
Code.


This siggy is copyrighted ©
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
16 Aug 2016 09:21 PM
The error is very clear. Models' don't have a Position property.
Report Abuse
mudkip99 is not online. mudkip99
Joined: 17 Jun 2008
Total Posts: 3362
16 Aug 2016 09:38 PM
If you want to move a model you'll want to give it a primary part and move it around using model:SetPrimaryPartCFrame(position)


Report Abuse
Zawie is not online. Zawie
Joined: 04 Jul 2010
Total Posts: 6338
16 Aug 2016 09:56 PM
You can just move a model with
Model:MoveTo(Vector3)
Report Abuse
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
17 Aug 2016 11:32 AM
So like, Model:MoveTo(Xnumber,Ynumber,Znumber)?
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
17 Aug 2016 12:15 PM
MoveTo takes a vector3 value as the argument.


Report Abuse
TheIceZombieSlayer is online. TheIceZombieSlayer
Joined: 26 Mar 2013
Total Posts: 267
17 Aug 2016 12:16 PM
Model:MoveTo(Vector3.new(Xnumber,Ynumber,Znumber))
Report Abuse
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
17 Aug 2016 01:10 PM
Okay, how do I write it so that the XYZ position is the position of another part so that when I move it I don't have to reset the position?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Aug 2016 01:11 PM
if x1 == x2 and y1 == y2 and z1 == z2 then


Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
17 Aug 2016 01:12 PM
Position is a vector3 value so if i understand your question correctly..

model:MoveTo(anotherPart.Position)


Report Abuse
CDDevelopment is not online. CDDevelopment
Joined: 16 Mar 2016
Total Posts: 509
17 Aug 2016 01:15 PM
Unless of course you mean that you don't want to write from 0,0,0? then you can simply try model:SetPrimaryPartCFrame(Model.PrimaryPart.CFrame+Vector3.new(1,0,0)) -- moves it + 1 stud on x.

I would not use moveto because if there's an object in the way it can severely skew the position to as much as 1000 studs away from the intended position.
Report Abuse
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
17 Aug 2016 01:43 PM
local doormodel = script.Parent.Parent.Parent.Parent
local doorm = doormodel.DoorM
local door = doorm.Door
local closed = doorm.Closed
local open = door.Open
local clicker = door.ClickDetector

function onClicked()--open
door:SetPrimaryPartCFrame(door.PrimaryPart.CFrame)
end

clicker.MouseClick:connect(onClicked)

I clicked it and output says, "SetPrimaryPartCFrame is not a valid member of Part"
Report Abuse
CDDevelopment is not online. CDDevelopment
Joined: 16 Mar 2016
Total Posts: 509
17 Aug 2016 01:48 PM
it'd be doormodel:SetPrimaryPartCFrame(door.CFrame+Vector3.new(howevermany x studs,howevermany y studs,howevermany z studs))
Report Abuse
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
17 Aug 2016 01:55 PM
Is the XYZ supposed to the position of the Primarypart?
Report Abuse
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
17 Aug 2016 02:20 PM
Wait so Vector3 would be not setting it to the position I want, but setting to how many studs it moves from it's current position?
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
17 Aug 2016 02:22 PM
wat no
you would add a vector if you want to do that

Formerly ToxicDominator - add 17,509 posts
Report Abuse
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
17 Aug 2016 02:24 PM
So it's setting the position? Even the command that CD was talking about?
Report Abuse
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
17 Aug 2016 02:24 PM
"Vector3.new(1,0,0)) -- moves it + 1 stud on x."

-CD
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
17 Aug 2016 02:24 PM
"Sets the CFrame of the PrimaryPart. All other parts in the model will also be moved and will maintain their orientation and offset respective to the PrimaryPart. This function will throw an error if no PrimaryPart exists for the Model."

Formerly ToxicDominator - add 17,509 posts
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
17 Aug 2016 02:26 PM
that's because he's taking the current CFrame of the primarypart and adding a vector to it

Formerly ToxicDominator - add 17,509 posts
Report Abuse
mudkip99 is not online. mudkip99
Joined: 17 Jun 2008
Total Posts: 3362
17 Aug 2016 02:28 PM
If you just want to move a model by X, Y, and z studs and not rotate it, you can just use TranslateBy:

model:TranslateBy(Vector3.new(X, Y, Z))

You don't need a primary part for that.
Report Abuse
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
17 Aug 2016 02:28 PM
Okay, so how do I set the position?
Report Abuse
addison10101 is not online. addison10101
Joined: 11 Jul 2011
Total Posts: 727
17 Aug 2016 02:29 PM
Oh ^^ Except I do want to rotate it so would I use CFrame?
Report Abuse
mudkip99 is not online. mudkip99
Joined: 17 Jun 2008
Total Posts: 3362
17 Aug 2016 02:36 PM
If you need it to rotate you'd have to set a PrimaryPart and use SetPrimaryPartCFrame. Here's an example that should rotate a model 90 degrees along its local Y axis.:

local degreesToRotate = 90

model:SetPrimaryPartCFrame(model.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(degreesToRotate), 0)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image