Jump to content

Проблема с moveObject и rotation


Recommended Posts

 

Вот функция, которая двигает объект, я понимаю, что нужно вместо rotation -80 писать какую-то формулу, которая будет определять на сколько ей нужно опуститься/подняться, но я такого результата достигнуть не могу. Поэтому прошу вашей помощи, заранее благодарю.

gateLSPD = false
x, y, z = getElementPosition ( source )
if getDistanceBetweenPoints3D ( x, y, z, 1544.24707, -1631.90906, 13.38281 ) <= 2 then
	if gateLSPD == false then
		local rotX, rotY, rotZ = getElementRotation(shlagLSPD)
		moveObject ( shlagLSPD, 2000, 1544.6999511719, -1630.9000244141, 13.10000038147, 0, -80, 0 )
		gateLSPD = true
		else
		local rotX, rotY, rotZ = getElementRotation(shlagLSPD)
		moveObject ( shlagLSPD, 2000, 1544.6999511719, -1630.9000244141, 13.10000038147, 0, 80, 0 )
		gateLSPD = false
	end
end

 

Link to comment
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...