Answer the question
In order to leave comments, you need to log in
How to rotate an object on each click of a button?
There is a scene with boxes. It is necessary to rotate the selected box with each click on the button. Now the box rotates only on the first click on the button. Subsequent presses do not respond.
let angle = SCNVector4(1, 0, 0, 90*(Double.pi/180))
func buttonAction(sender: UIButton!) {
cubes.boxOne.runAction(SCNAction.rotate(toAxisAngle: angle, duration: 1))
print(cubes.boxOne.rotation)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question