Hi, I need to move a sphere when I click a button. I have a problem with that, I'm new using Unity and I am a C# programmer.
When I try to move the sphere, the first problem I have is that I don't know how to reffers to this sphere. Also, I don't know the commands to move the sphere.
The button has an onClick event that and I can see a text when I click on it. The sphere has a rigidbody.
Can anyone help me? Thanks!
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
126 People are following this question.
Button OnClick function?
AddListener in foreach
UI Buttons do not work when material is applied to it?
UIButton not working when testing on mobile device
What is the best way to use buttons?