Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 svl · May 10, 2012 at 09:50 AM · moveboxforward

move box forward

Hey, i like to move my box while pushing. But the code is not working.

function OnCollisionEnter(collision : Collision) {

 if(collision.gameObject.tag == "man"){
 Debug.Log("hit2");
     transform.position = Vector3(464.8797,1.678224,1.839526);
 }

}

Stijn

Comment
Add comment · Show 3
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 syclamoth · May 10, 2012 at 10:12 AM 3
Share

For starters, that code is very weird. Why are you changing the position to some very specific Vector3? What do you hope to achieve with that?

Otherwise, this is just another '$$anonymous$$y thing doesn't collide with this other thing' question, similar to about 1000 other question on this site. Please use the search bar before posting.

Here are some sample posts to get you started:

http://answers.unity3d.com/questions/192271/collision-problem.html

http://answers.unity3d.com/questions/223213/simple-collision-code-problems.html

http://answers.unity3d.com/questions/17828/problem-with-collision-detection.html

http://answers.unity3d.com/questions/150859/collision-problem-with-fpc.html

http://answers.unity3d.com/questions/217686/why-to-collision-detectio-isnt-working-.html

avatar image svl · May 11, 2012 at 02:09 PM 0
Share

thanks Stijn

avatar image maroonrs2 · May 11, 2012 at 02:19 PM 0
Share

Wow, ok. That is the first fail i've seen in like 5 $$anonymous$$utes. @syclamoth
What he is trying to accomplish is unnecessary.

1.) Click on the object that needs moved.
2.) Go to Component.
3.) Go to Physics.
4.) Add a rigidbody.
5.) Do that to your character/thing-that-is-touching-the-box.

Why create physics when you already have them?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Chimera3D · May 11, 2012 at 05:06 PM

Just use transform.Translate or use a rigidbody which allows for really nice physics. Just set the object's mass to like .5 or something. Really, USE THE SEARCHBAR to find things that have already been asked and answered before. This is really simple.

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.

Follow this Question

Answers Answers and Comments

7 People are following this question.

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

Related Questions

How would I make it so that my character moves only so fast 1 Answer

How to lerp back and forth? (ex. platform) 2 Answers

Moving Forward With Physics 1 Answer

move character controller forward using gui button. 1 Answer

How to Move Controller Forward Automatically? 0 Answers


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