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
1
Question by Karsnen_2 · Dec 20, 2012 at 03:36 PM · iosshurikeneffects

Particle system not to follow the GameObject?

Hello Devs,

GOAL :

I am trying to re-create a wind effect for my game. The wind should resemble more or less a swirl wind or a mini tornado. To give a picture representation, I would like the particle effect to follow the circular arrows like in the picture below.

alt text

They should start at the bottom & reach the top.

METHOD I USED :

I thought that if I have particles moving up on the Y axis and If I happen to rotate the GObject, I could get a similar effect. But I ended up have my particles following me rather than moving in circles.

HYPOTHESIS:

But I think that I need add any code to the GObject and such an effect is possible through shuriken particle system. I am just stuck right and I do not know, what kind of an approach I should use.

What would be the best way to do it using a particle system?

Thank you,

Karsnen.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by KingKongFu · Dec 20, 2012 at 03:46 PM

Just a though if you are just rotating the particle on the Y axis then it may be doing what "you want it to do" but not how you want it to do it. You may have to send the particle out a bit on the up vector to make it spin not just rotate. Im just think out loud here. Hope that helps

camera code

 var target : Transform;
 var distance = 10.0;
 
 var xSpeed = 250.0;
 var ySpeed = 120.0;
 
 var yMinLimit = -20;
 var yMaxLimit = 80;
 
 private var x = 0.0;
 private var y = 0.0;
 
 
 var smoothTime = 0.3;
 
 private var xSmooth = 0.0;
 private var ySmooth = 0.0; 
 private var xVelocity = 0.0;
 private var yVelocity = 0.0;
 
 private var posSmooth = Vector3.zero;
 private var posVelocity = Vector3.zero;
 
 
 @script AddComponentMenu("Camera-Control/Mouse Orbit smoothed")
 
 function Start () {
     var angles = transform.eulerAngles;
     x = angles.y;
     y = angles.x;
 
     // Make the rigid body not change rotation
     if (rigidbody)
         rigidbody.freezeRotation = true;
 }
 
 function LateUpdate () {
     if (target) {
         x += Input.GetAxis("Mouse X") * xSpeed * 0.02;
         y -= Input.GetAxis("Mouse Y") * ySpeed * 0.02;
 
         xSmooth = Mathf.SmoothDamp(xSmooth, x, xVelocity, smoothTime);
         ySmooth = Mathf.SmoothDamp(ySmooth, y, yVelocity, smoothTime);
 
         ySmooth = ClampAngle(ySmooth, yMinLimit, yMaxLimit);
 
         var rotation = Quaternion.Euler(ySmooth, xSmooth, 0);
 
        // posSmooth = Vector3.SmoothDamp(posSmooth,target.position,posVelocity,smoothTime);
 
         posSmooth = target.position; // no follow smoothing
 
         transform.rotation = rotation;
         transform.position = rotation * Vector3(0.0, 0.0, -distance) + posSmooth;
     }
 }
 
 static function ClampAngle (angle : float, min : float, max : float) {
     if (angle < -360)
         angle += 360;
     if (angle > 360)
         angle -= 360;
     return Mathf.Clamp (angle, min, max);
 }
Comment
Add comment · Show 5 · 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 Karsnen_2 · Dec 20, 2012 at 03:51 PM 0
Share

How do you make it spin? I am trying to rotate the particle effects using Rotation by Speed. i.e. I am trying to add some angular velocity. It does not make any difference.

avatar image KingKongFu · Dec 20, 2012 at 04:23 PM 0
Share

There are two things here that I can see.

1: $$anonymous$$ove the object upwards

2: $$anonymous$$ake it spin around a local axis

So what I would do is to take the orbital camera like this one I put above. Just mod that a bit and ins$$anonymous$$d of a camera you can put the particle effect you want on it and then have that move around the position.

avatar image Karsnen_2 · Dec 20, 2012 at 08:22 PM 0
Share

$$anonymous$$ing$$anonymous$$ongFu -> why do need to use Camera in the first place? I am missing you here.

avatar image KingKongFu · Dec 20, 2012 at 08:32 PM 0
Share

No, dont use the camera thats just the idea. What I was thinking is use the camera code to help you figure out how to get the particle effect to move around in a cylinder rater than spin/ rotate in a single Y value.

A arc ball cam does just that. I revolves around a center point but does not touch that point.

If you think about it a particle effect is 2d so it will look the same way in any direction you look at it. So to get your spin I think that you will have to move it around not just rotate it in one position. I may be wrong with my assumptions here seeing I just started to learn unity. But its kinda the same as a billboard from other game engines so I would assume that its the same for unity

avatar image KingKongFu · Dec 26, 2012 at 02:54 PM 0
Share

Here we go I found a general purpose scripts that can help you out http://wiki.unity3d.com/index.php?title=ArcBall∾tion=edit

This way the effect will circle around the target just make the center of the tornado spiral thingy the target and all should be good I think

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

10 People are following this question.

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

Related Questions

Most efficient way to darken the screen? 3 Answers

Scaling the whole Shuriken effects? 1 Answer

Can you change the speed of a spawned particle? 2 Answers

Particle/Line renderer sword slash effect 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 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