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 Timmyglen2 · Dec 27, 2010 at 11:28 PM · javascriptphysics

How to make a glue gun?

I am planning on making a puzzle platformer, and my gameplay method will be fps, and I will have a weapon that would place a glue on any surface that the ammo would touch (basically I would put glue on the floor). I know that to make stuff stick then I would make it create a joint on anything that has a collision to it, but what I don't know is how to make the glue itself. One possibility is to make the gun spawn many, really small spheres that would have the "joint creation" script on it, but I was wondering if there is any other suggestions. Scripts for my glue or your ideas would be appreciated as well.

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 Timmyglen2 · Dec 27, 2010 at 11:35 PM 0
Share

By the way, any script you have I would like in java if possible. THanks.

avatar image Jesse Anders · Dec 28, 2010 at 01:59 AM 0
Share

Java isn't supported in Unity. (Yes, I know you mean javascript, aka Unityscript, but since Java and javascript are completely separate languages, the names 'Java' and 'javascript' really shouldn't be used interchangeably.)

avatar image Timmyglen2 · Dec 28, 2010 at 04:27 AM 0
Share

Thank you Jesse for the correction (and I do not mean that sarcastically, I only started using this program less than a week ago, and while I know the basics, I am far from being an expert).

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Jason B · Dec 28, 2010 at 12:38 AM

In thinking about this for a while I can't think of a good, FAST way to do it that wouldn't require a lot of crazy math.

The "create a sphere for every blob of glue" is pretty much the easiest solution I can think of, but I would recommend not using an actual sphere for the model or your polygon count will quickly shoot through the roof. You may instead want to use no model at all, an invisible rigidbody with a collider in the shape of a sphere, and perhaps a decal for the glue splat.

Or be careful to limit the amount of glue blobs in play at one time, and model a special low-poly blob that has no polygons behind it to stick to surfaces, for performance's sake.

Another tip for not letting the game be overrun with too many glue blobs in one spot would be for each new blob to detect other blobs around it, and if it's too close, it doesn't stick. Then you could get a natural, even coating of the glue without it crowding and causing unnecessary lag.

Comment
Add comment · Show 2 · 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 Timmyglen2 · Dec 28, 2010 at 04:29 AM 0
Share

Thanks for the support, and when you say decal, you mean make it spawn a picture of the splat on the surface it hits when it collides with the surface, Right? Also, when you say it doesn't stick, I would also assume that you are saying to delete as well if it enters those perameters. Sorry for all the questions, I am new to Unity.

avatar image Timmyglen2 · Dec 28, 2010 at 05:16 AM 0
Share

Also, I want a solvent, and something I was thinking of was creating a script that deleted itself as well as the object it collides with, but only if it collides with a specific object. Even just a part of script that would show how to make it work with only that object.

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

hit.rigidbody.useGravity problem? 1 Answer

How do I switch from Character player to Airship Vehicle using triggers? 0 Answers

Best way to go about having many fast objects with physics 0 Answers

How to 'flick' objects in a 2d game 1 Answer

Clamp Bike Rotation 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