Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 aligurelli · Aug 09, 2019 at 05:31 PM · positionmovemove an objectlocalposition

transform.position not moving object

hi,

i have car object and I am trying to move it below code in update method:

 car1.transform.localPosition -= Vector3.up * Time.deltaTime *10;

i also tried position instead of localPosition but nothing changed. I don't understand why its happens because in the another script same code is working as expected. Do you have any idea why it doesn't work?

Thanks

Comment
Add comment · Show 4
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
avatar image sacredgeometry · Aug 09, 2019 at 06:02 PM 0
Share

Where is that statement?

avatar image aligurelli sacredgeometry · Aug 09, 2019 at 06:03 PM 0
Share

in update method @sacredgeometry

avatar image sacredgeometry · Aug 09, 2019 at 06:10 PM 0
Share

Also just a tip. You need to give people more information because this isnt enough information on its own to give you any sensible answers. It could be a million and one reasons. That said:

avatar image sacredgeometry · Aug 09, 2019 at 06:11 PM 1
Share

https://www.youtube.com/watch?v=njATNVV$$anonymous$$ScY&feature=youtu.be

This shows the assumed use

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by k234234w · Aug 09, 2019 at 06:15 PM

Can we see your full script. If the object is marked static, or if your Timescale is 0 it will not move.

Comment
Add comment · Show 4 · 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
avatar image aligurelli · Aug 09, 2019 at 07:03 PM 1
Share

@k234234w yes accidentally I marked it as static. thanks.

avatar image sacredgeometry aligurelli · Aug 12, 2019 at 05:05 AM 0
Share

please, please, please learn what the code you are writing means, At the very least learn one thing: What the static keyword means.

I see so many people using it on almost all their members. You should rarely see it.

avatar image k234234w sacredgeometry · Aug 13, 2019 at 12:21 AM 1
Share

I am assu$$anonymous$$g he marked the game object as static, not the class. Those are different things. https://docs.unity3d.com/$$anonymous$$anual/StaticObjects.html

Show more comments
avatar image
-1

Answer by I_Am_Err00r · Aug 09, 2019 at 06:18 PM

 car1.transform.Translate(Vector3.up * 10 * Time.deltaTime);

I think that's what you are looking for, but I'm not too sure because you have a -= and then Vector3.up, so it might Vector3.down you are looking for, I'm not sure what you are trying to do as the other comments are saying.

Comment
Add comment · Show 1 · 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
avatar image sacredgeometry · Aug 09, 2019 at 07:37 PM 0
Share

It should still work.

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.

Follow this Question

Answers Answers and Comments

135 People are following this question.

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

Related Questions

Unity2D move + turn with a fixed angle 1 Answer

How to move camera on an angle 1 Answer

Moving an object object x pos + speed?? 0 Answers

C# move a cube slowly 1 Answer

How I can make the position of an object equal when you add another object? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges