SetData("Position/PositionX"...) set avatar in wrong position
When using SetData("Position/PositionX"...) on props there is no issue. It works fine.
But when try use it on an avatar will set it to the wrong position. pos_x=-1084 avatar.GetControl("Transform").GetDataBlock().SetData("Position/PositionX", RLPy.RTime(time_value), RLPy.RVariant(pos_x))
I just tested this, and this works for me as expected.
#-- Get Characters from current scene --#
avatar_list = RLPy.RScene.GetAvatars()
#-- Get Character, Change index for now --#
avatar = avatar_list[0]
# get the time at the start
time = RLPy.RTime(0)
posX = 170
# moving avatar
text_edit.insertPlainText("Moving Avatar To Position: " + str(posX) + "\r\n")
control = avatar.GetControl("Transform")
control.GetDataBlock().SetData("Position/PositionX", time, RLPy.RVariant(posX))
# get the rotation value for this prop
transform = RLPy.RTransform()
control.GetValue(time, transform)
newPosX = transform.T().x # Get Prop x position
# show the new position
text_edit.insertPlainText("New Position: " + str(newPosX) + "\r\n")
I set it to 170, and it ends up on 170. Maybe this has been fixed since January 2019.
The-any-Key
Setting rotation works however
1
You are going to edit a submitted issue. This issue will be changed to private draft mode until you click submit again. Are you sure?