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 Fubiou · Nov 11, 2010 at 06:19 AM · rigidbodypickuplaunch

Phisics question! How can I launch this object?!??!?!?!!

XXXXXXXX SOLUTION FOUND, WAS JUST TO ZERO THE VECTORS XXXXXXXXX

I have an almost done script here, it works almost fine but when I launch the model its behave isnt what I expect.

works this way: the object has this script attached and my character, when collide with its child collider is able to pick it up, it does work well, and then, he is up to launch it but the physics isnt work the way I want.

here it is:

I was reading about possible solutions for this issue, one of then is probably "Force.Impulse" other is "vector3.normalize".

since 22 days ago I knew about nothing about programming, I really dont know how to appy it, can anybody help with this??!??!?

thanks alot in advance!

var playerHand : Transform;

var pegou = false;

var soltou = false;

var upforce = 6000.0;

var frontforce = 3000.0;

function OnTriggerStay (other : Collider) {

if(other.transform.tag == "Player" && Input.GetButton("Fire1")){

 pegou = true;

 timeDelay = 0;

}

 }



 function Update() {



 if (pegou){



 var colisorzao = transform.parent;

 colisorzao.parent = playerHand;

 colisorzao.rigidbody.isKinematic = true;

 colisorzao.rigidbody.detectCollisions = false;

 colisorzao.position = playerHand.position;

 colisorzao.rotation = playerHand.rotation;

}

if (pegou && Input.GetButton("Fire2")){

pegou = false;

timeDelay = 0.0;

soltou = true;

}

if(soltou){

colisorzao = transform.parent;

colisorzao.rigidbody.isKinematic = false;

colisorzao.rigidbody.detectCollisions = true;

transform.parent.rigidbody.AddRelativeForce (0, upforce , frontforce);

colisorzao.parent = null;

}

}

function segurar () {

return pegou;

}

function soltar (){

return soltou;

}

Comment
Add comment · Show 5
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 HolBol · Nov 11, 2010 at 09:25 AM 0
Share

Please format your script properly.

avatar image Fubiou · Nov 11, 2010 at 06:15 PM 0
Share

I am a complete noob on this, sorry.

avatar image Fubiou · Nov 11, 2010 at 06:54 PM 0
Share

btw

"collisorzao" means Big Collider, "Pegou" means "held" Segurar means "hold" , "soltar" means "release"

avatar image BinaryCaveman · Nov 12, 2010 at 12:13 AM 1
Share

Because this question has been answered (by yourself), please post an answer with your solution, and mark the answer as accepted. This will show that this question does no longer need a solution, and will allow for more questions to be answered. Thank You!

avatar image Justin Warner · Nov 12, 2010 at 05:12 AM 0
Share

Also, program$$anonymous$$g is in english, always in english, one of the first things I learned in my program$$anonymous$$g class was to always use english terms because it's not made for any other language...

0 Replies

· Add your reply
  • Sort: 

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

No one has followed this question yet.

Related Questions

pretty weird issue with rotating a sphere 2 Answers

A node in a childnode? 1 Answer

Very simple picking up items script? 2 Answers

How would I make an object disappear after a set amount of time? 3 Answers

Errors with gravity switching... 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