Question by
tomashevskiysergiy · Dec 28, 2020 at 06:17 PM ·
raycastikprocedural animation
changing position of sphere matching objects
Creating raycast from object down with this code
if (Physics.Raycast(stepTarget.position, Vector3.down, out hit)) { stepTarget.position = hit.point; stepTarget.rotation = Quaternion.FromToRotation(Vector3.up, hit.normal); }
it works when game starts, so it's attaching my sphere to the ground or whatever is below it(and rotate it also), tried in different types of object,but i want to make it move and change rotation and position dynamically(it works with i create raycast from mouse position) ,but not with moving it in the scene.
how to make it go up and down to and from objects.alt text
screenshot-1.png
(15.2 kB)
screenshot-2.png
(1.0 kB)
Comment
Your answer
Follow this Question
Related Questions
character position change when adding two bone ik 0 Answers
Check if position is inside a collider 5 Answers
onMouseUp 2D Issues 0 Answers