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 /
avatar image
0
Question by Chocolade · Nov 23, 2016 at 10:42 PM · c#effecteffects

How can i implement the exhaust effect prefab i have in the back of my spaceship ?

In the screenshot you can see in the Hierarchy i dragged the Engine(The exhaust effect prefab ) to be child of my spaceship but when running the game it's not showing the effect.

If i will just drag the Engine to the Hierarchy not as child i will see the effect fine but i want to implement it on the back of my spaceship.

If i change the Engine position and put it a child of my spaceship i can then set it's position to be on the spaceship but is there any way to set it automatic to be on the back of my spaceship ?

In the screenshot it's the back of my spaceship and you can see in the scene window the Engine sit small on the ship top. And i want it to be on the back on the two exhausts places.

UndamagedShip is the spaceship. And the child Engine is the exhaust effect i want to add to it's back.

screenshot

And then i want to control from a script on the exhaust effect. In this script i tried to make acceleration to my ship when i press the p key. But i don't want to use Rigidbody i just want to make that when i press the p key it will give some boost power speed to my spaceship and the exhaust effect will act more or less power according to how much i press the p key.

The Engine the exhaust effect i downloaded from here:

Engine Download

 using UnityEngine;
 using System.Collections;
 
 public class ControlShip : MonoBehaviour {
 
     public int rotationSpeed = 75;
     public int movementspeed = 10;
     public int thrust = 10;
 
     bool isPKeyDown = false;
     float acceleration = .0f;
 
     Vector3 previousPosition = Vector3.zero;
 
     Rigidbody _rigidbody;
 
     // Use this for initialization
     void Start () {
 
         _rigidbody = GetComponent<Rigidbody>();
         Debug.Log("Acc Speed: " + thrust);
     }
     
     // Update is called once per frame
     void Update () {
 
         var v3 = new Vector3(Input.GetAxis("Vertical"), Input.GetAxis("Horizontal"), 0.0f);
         transform.Rotate(v3 * rotationSpeed * Time.deltaTime);
         transform.position += transform.forward * Time.deltaTime * movementspeed;
 
         if (Input.GetKey(KeyCode.Z))
             transform.Rotate(Vector3.forward * rotationSpeed * Time.deltaTime);
 
         if (Input.GetKey("p"))
         {
             isPKeyDown = Input.GetKey("p");
             float distance = Vector3.Distance(previousPosition, transform.position);
             acceleration = distance / Mathf.Pow(Time.deltaTime, 2);
 
             previousPosition = transform.position;
             _rigidbody.AddRelativeForce(0f, 0f, thrust, ForceMode.Acceleration);
         }
     }
 
     void OnGUI()
     {
         if (isPKeyDown)
         {
             GUI.Label(new Rect(100, 100, 200, 200), "Acc Speed: " + acceleration);
         }
     }
 }
 


ss24.jpg (456.5 kB)
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 Adam-Mechtley · Nov 25, 2016 at 12:36 PM

Hi @Chocolade! In the Inspector for your particle emitter, the "Simulate in Worldspace" checkbox is ticked, which means the particle ignores the transform matrix hierarchy it inherits. Turn that off and it should follow your ship just fine.

For your second question, a lot of the features in the Legacy particle system never had proper API points added, which is part of the reason the Legacy system is being deprecated (per the warning in the Inspector). That said, it looks like unfortunately when the documentation was updated to put in appropriate warnings, links were removed to API points on ParticleEmitter. For example, there is the Emit () method, which might give you something to work with. I'll file a bug with the docs team.

Comment
Add comment · 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

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

244 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Freezing effect on camera 0 Answers

Code in void not executing 0 Answers

This script opens up an Audio Source but what would I need to do to get it to open up a Resonance Audio Source instead? 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