• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by N.Andrei · Aug 12, 2012 at 07:04 PM · objectmovecharacter controllertransform.translatewithout

Move an object without Character Controller?

Is it possible to move an object without using a character controller or addForce but just by using the transform.Translate and transform.Rotate?I am new at this and I get stuck at this thing because I want to make an object move without using a character controller or the addForce to a rigidbody but just by scripting it.......the translation and rotation. Any help appreciated!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Loius · Aug 12, 2012 at 07:40 PM

Yes.

...

Fiiine. You certainly can. Are you having a specific issue? You can directly alter position/rotation through transform.position (a Vector3) and transform.rotation (a Quaternion). You can also set rotation by using tranform.forward, .right, and .up, but you can run into issues using those if you're looking around in 3D. Better to use Quaternion.LookRotation in that case.

For instance, this'll make an object move according to the Horizontal and Vertical axes set up in project settings, and the object will snap to face the direction it's moving.

 var desiredMovement : Vector3 = Vector3( Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical") );
 transform.position+= desiredMovement;
 if ( desiredMovement.sqrMagnitude > 0 ) transform.forward = desiredMovement;
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

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.



Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Make an object move without a Character Controller? 2 Answers

using Transform on a Object will not move it 100% exactly... 1 Answer

make an object move when its clicked 1 Answer

How to change scenes without reloading them. 2 Answers

How should I move an object that parents on collision? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges