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 » Scripting Helpers
Home Search
 

Re: "z cannot be assigned to"

Previous Thread :: Next Thread 
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
05 May 2013 08:28 PM
I've got a script where I generate a Vector3 Value object inside of each part in a group, and it's supposed to assign rotation vector3 to said object's value. I first tried

ORot.Value = ORot.Parent.CFrame:toEulerAnglesXYZ()

But it told me that instead of recieving Vector3, it was given number values. I was thinking "yeah, that's fine, I knew about that beforehand" and changed the code to the following:

ORot.Value.x, ORot.Value.y, ORot.Value.z = ORot.Parent.CFrame:toEulerAnglesXYZ()

But instead of working... it gave me the above error. I'm wondering why in oblivion you can't assign the separate parts of a Vector3- or am I just doing something horribly wrong?
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
05 May 2013 08:32 PM
Take off the :toEulerAngles on z, and try this:

z:toEulerAnglesXYZ()
Report Abuse
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
05 May 2013 08:34 PM
That... doesn't sound like it would work. "z" is part of a Vector3 Value object, detached from actual parts... meaning it's not actually doing anything, just being a value.

I'll try it anyways, in case my understanding of syntax is some kind of wrong.
Report Abuse
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
05 May 2013 08:36 PM
Didn't take long, the script's error check was already telling me it wouldn't work (thank you wiggly red line).
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
05 May 2013 08:45 PM
ORot.Value = Vector3.new(ORot.Parent.CFrame:toEulerAnglesXYZ())

I think you got that error because you can't set Position.x, you can only read it
Report Abuse
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
05 May 2013 08:57 PM
Ah, thank you. I keep forgetting that if you want a Vector3, you need to make a 'new' one.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
05 May 2013 09:27 PM
No prob :)
Report Abuse
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
05 May 2013 09:48 PM
Went through testing, thought that this was dealt with, but it turns out the major issue I'm having at the moment is this again.

I tried by that method, but it would only produce a Vector3 of 0, 0, 0.
Report Abuse
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
05 May 2013 09:49 PM
ORot.Value = Vector3.new(ORot.Parent.CFrame:toEulerAnglesXYZ())

No errors produced, just gives me 0, 0, 0... and I know that the parts are most certainly not all at the origin.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
05 May 2013 09:58 PM
It gets the rotation not position o-o.
Report Abuse
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
05 May 2013 10:36 PM
Moment of stupid. Position is a totally different problem. Sorry.

I'll look into it.
Report Abuse
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
05 May 2013 10:52 PM
Actually, I just checked both the values I'm creating (one for position, the other for rotation). They both show up as 0, 0, 0.

Any insight?
Report Abuse
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
05 May 2013 10:53 PM
Nevermind. I'll make a new thread on it tomorrow, when I have the time to actually respond.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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