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 Narwrynn · Sep 14, 2014 at 04:20 AM · 2d

Launching Projectile Problems (2D)

Edit2: I solved my problem for the sake of completeness, so that if anyone else finds this while trying to do something similar I'll explain what I did. ->I changed the monkeys prefab to default to "newMonkey" ->Any monkeys that start in the game world but not in a net are manually tagged the proper color ->Any monkey with a tag other than "newMonkey" are destroyed on contact with the hammock collider ->Instantiate a fake monkey placeholder that has no collider or rigid body at the hammock location (Just to look like a monkey is in the net) ->When the ejectMonkey button is pushed destroy the fake monkey and instantiate the real monkey and immediately apply force ->Because this monkey is tagged newMonkey it ignores the onTriggerEnter that would normally destroy it ->Then OnTriggerExit Change the monkeys tag to the proper color

Edit: I took a break to clear my head and came up with the start of a solution. I created a "netEmpty" variable and set it to true. I then adjusted my OnCollisionEnter function to be an if statement that only runs if the net is empty. It then sets the netEmpty=false and when the object is ejected in the update function returns to true. So far the monkey falls immediately but at least he is not locked in place and changes color.

So I spent about 4 hours working on this an checking other peoples questions and tried every solution suggested in those so I'm going to see if y'all can give a more tailored answer.the most recent thing I have tried is destroying and instantiating a whole new monkey.There is a lot of vestigial code here that does nothing just left overs from trying stuff out.

So let me explain what I'm trying for. I have monkeys that you shoot from hammock to hammock, when they land in a hammock they are changed to that color. Then they stay in that hammock until the mouse is clicked again then they are fired towards that click. Right now the monkey does not rotate when the net does, but I'm not worried about that right now. I just what the bugger to to get flung out when I click. Colliding, changing color, even my scoring and picking up objects this is literally my last thing to do before I start actually building levels, everything but the actual shooting part works.

The monkey prefab has a rigid body, it has a mass of .5 and gravity scale of 1. The hammock is marked as "is trigger." The monkey has no physics material but I have tried it with one with .4 friction and 1 bounciness. Thanks in advance for any suggestions.

Also sorry for the poor grammar, English was my worst subject in school. =P

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

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

2 People are following this question.

avatar image avatar image

Related Questions

Want to make a JRPG. 1 Answer

Strange GOs Bounce after parenting 2D game 0 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

2d water simulation simulation 1 Answer

2D pong game. HELP 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