Bylocks
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 773 |
|
|
| 29 Apr 2017 10:37 AM |
| How can I change one value in a vector3, say the y value |
|
|
| Report Abuse |
|
|
|
| 29 Apr 2017 10:39 AM |
local v3={ x=0, y=any integer, z=0 }
script.Parent.Position=Vector3.new(v3.x, v3.y, v3.z) |
|
|
| Report Abuse |
|
|
Dankvisky
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 5430 |
|
|
| 29 Apr 2017 10:40 AM |
Vector3.new(currentvector.X,newYValue,currentvector.Z)
currentvector is just the current vector
Alternatively you could do: currentvector + Vector3.new(0,how much to add to Y,0)
|
|
|
| Report Abuse |
|
|
|
| 29 Apr 2017 10:40 AM |
or maybe
script.Parent.Position.Y=1 |
|
|
| Report Abuse |
|
|
Bylocks
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 773 |
|
|
| 29 Apr 2017 10:44 AM |
workspace.Placing.barricade = Vector3.new(currentvector.X,3.928,currentvector.Z)
it says i need to define current vector |
|
|
| Report Abuse |
|
|
Dankvisky
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 5430 |
|
|
| 29 Apr 2017 10:45 AM |
@Goml Wasnt it only readable?
|
|
|
| Report Abuse |
|
|
Bylocks
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 773 |
|
|
| 29 Apr 2017 10:48 AM |
got it
local currentvector = workspace.Placing.barricade.Position workspace.Placing.barricade.Position = Vector3.new(currentvector.X,3.928,currentvector.Z)\
works thx |
|
|
| Report Abuse |
|
|
|
| 29 Apr 2017 10:48 AM |
Because you need to define CurrentVector. Set it to the current vector you are changing.
|
|
|
| Report Abuse |
|
|