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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by sudoadmin · Dec 02, 2015 at 10:06 AM · c#particlesystemline

Drag line between game objects

I'm trying to make a game where you drag lines to connect objects of different colors but cant make the lines cross eachother. I have a particle system designed for the line. So my idea is to have the particle system be disabled until the player touches it, then you drag and the particle system would change it's length to have one end where the players finger/mouse is. I would want the x axis to change length to match the mouse position and to rotate instead of acting as a trail...

I'm sorry if this is a basic question, I'm new to C#.

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 sudoadmin · Dec 02, 2015 at 09:07 PM 0
Share

To further this question, I think I know a way I could do this using a game object that is always underneath the mouse, i have looked at many codes and tried them all and none of them make the game object move, if you could tell me how to do this also that would be great.

avatar image Cherno sudoadmin · Dec 03, 2015 at 12:37 AM 0
Share

A line Renderer would be far easier to use, as you can just set the start and end points.

Anyway, for a ParticleSsystem, you would have to find the halfway point between the start point and the current end point (where the cursor is). Here is an answer that will help you with this. Then you would have to somehow calculate the size of the ParticleSystem so it reaches both points exactly. This depends on how big the PS and it's particle is initially. To rotate the PS so it's x axis (left axis) points towards the end or start point, you may be able to use Transform.LookAt and make it look at a point that is perpendicular to the directional vector between start and end point.

avatar image sudoadmin Cherno · Dec 03, 2015 at 07:58 PM 0
Share

Thank you, and the problem with line render is that its not animated, It's too blank... so if there is a way to apply an animation to it that would be amazing.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Visual Studio 2010 causing: Inconsistent Line Endings... 3 Answers

How to increase max particles in a particle system against a timer? 0 Answers

How to change the sprite in "texture sheet animation" from three different sprites? 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