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 MarceloCosta_GamesBR · Jul 22, 2014 at 05:30 PM · followempty

Make Empty Follow an Object

i have an empty with 4 directions and i need make empty position follow the ball pivot in Axes X,Y,Z but no rotation

Code:

 Vector3 vec_shooting_bola = new Vector3(ball.rigidbody.velocity.x, ball.rigidbody.velocity.y, ball.rigidbody.velocity.z);
 
 empty_shootingBall.position = ball.position;


image: alt text

dd.png (31.9 kB)
Comment
Add comment · Show 1
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 MarceloCosta_GamesBR · Jul 23, 2014 at 09:53 AM 0
Share

i am making the empty with directions follow the ball in real time the ball have physics of an real ball but when the ball moves then the empty follow ball with smooth and get sliding til the ball stop......

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by CScherer549 · Jul 22, 2014 at 06:20 PM

I take it your solution isn't working? Have you tried parenting the empty to the object?

http://docs.unity3d.com/Manual/class-Transform.html

You should be able to use that and set it's rotation to 0 through a script. If that's not what you need let me know.

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

Answer by MarceloCosta_GamesBR · Jul 23, 2014 at 07:43 AM

Problem Solved

Instead of taking the position of the transform of the ball I took the position of the bone of the ball, it armature then following this perfectly now

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

Answer by ironblock · Jul 23, 2014 at 10:07 AM

this should do the trick.

 Vector3  offset = new Vector3 (0,2f,0);
             float step = walkSpeed * Time.deltaTime;
             transform.position = Vector3.MoveTowards(transform.position, target.transform.position+ offset, step);

Comment
Add comment · Show 1 · 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 MarceloCosta_GamesBR · Jul 25, 2014 at 04:25 AM 0
Share

thanks brother

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

Camera rotation around player while following. 6 Answers

car follow ai 1 Answer

Follow only on Z axis? 1 Answer

Follow x rotation of a target object. 1 Answer

Enemy Pirate Ship AI 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