when it touches my left screen, i want it to go to a random angle
if((transform.position.x - renderer.bounds.extents.x) <= _screenBoundLeft)
{
_driftVelocity = new Vector3(-_driftVelocity.x*Random.Range(0.2f,0.8f) , _driftVelocity.y*Random.Range(0.2f,0.8f), 0f);
}
Dantus
3
Bump after 3 hours? Seriously?
And checking your recently started threads shows me that most of them are extremely related!
can you please give me a solution if possible. Its my humble request
The best thing you can do is to learn programming and some basic algebra for a change.
simple answer to my problem could definitely have helped me.
Forums are for help, not for suggestions.
Avo
7
It seems like this individual is working on something similar to what you want. You may be able to find what you need here.
http://forum.unity3d.com/threads/137993-GameObject-Bouncing-inside-a-room-with-a-static-velocity
If you want to change an angle, you have to call the Euler angle.
You can do so by using Quaterions.Euler(x y z)
The Euler angles are just the individual rotations along the specified axis.
Best,
Jon