|
I can't seem to get this to work, what I'm trying to do is get the gameObject to add force in the direction of the hit point of the raycast which is being casted from the mosue position, however nothing I have tried so far works. Here's my code:
(comments are locked)
|
|
Well the direction of the hit is the direction of the ray - which you can get from ray.direction. Or are you thinking you want to take the direction from something else? in which case your moveDir logic is backwards right now and you probably want to do a .normalized on it. That helped, but the object won't follow the mouse on the x axis.
Jul 13 '12 at 09:12 PM
Chimera3D
You want it to follow the mouse? Because adding a force will push it away...
Jul 13 '12 at 09:25 PM
whydoidoit
Yes, what forces should I add because I don't want to use transforms?
Jul 13 '12 at 09:28 PM
Chimera3D
That would be incredibly hard to work out - if you want something to follow the mouse you pretty much have to use transform modification.
Jul 13 '12 at 09:32 PM
whydoidoit
Ok then, I already knew how to do it with transforms. Well how can I get the object to rotate towards the hit point one one axis?
Jul 13 '12 at 09:43 PM
Chimera3D
(comments are locked)
|
