Advertisement

i need help in unity

Started by September 25, 2018 11:02 PM
6 comments, last by Kamal Wafi 6 years, 2 months ago

hey guys , i already start learning unity , and im working in my first game , i found a problem which stop me .

i want to keep the Cartesian coordinate without moving 
like this https://imgur.com/a/XCSMtc0

and not when the ball move it become 
https://imgur.com/a/bMORNPw

so then when i add force to vector y i will find no problem
but when the vector move and start looking not up , then the ball it goes to a place which i dont want (left or right)

Have you considered a 'freeze rotation' on your balls rigidbody component.

Throwing stuff at my 'Hobby Game"

Advertisement

freeze rotation but this will stop the rotation complety , i want it to rotate when it touch something .

(by the way i want the ball to Rotate around it self but without 
Cartesian coordinate (vector y stay looking up , x on right ...) )

I'm guessing that you're using the X and Y for jumping and moving right? Why not create a parent class that has the movement script attached to it then put a child game object that rotates inside it.

Yes yes , complety true , im using x for moving and y for jump , and im using so simple code ,so can you please explain more with example or links can help me to do that ?

I think iRyu is saying that you can have a game object which you move directly through your script, then attached to that game object is the ball game object that can spin freely. That way, you can move the ball around with a fixed reference frame (from the parent object) and have it (the ball object itself) spin.

-Mark the Artist

Digital Art and Technical Design
Developer Journal

Advertisement

Oh i think i get what you mean 

This topic is closed to new replies.

Advertisement