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 /
This question was closed Dec 11, 2014 at 07:06 PM by DarkSlash for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by DarkSlash · Dec 05, 2014 at 09:59 PM · movementitweenmovetowardsplaymaker

Playmaker: How to use transform.position in actions

I want to move and object to an Y position, but NOT on the X axis, just in the Y. Lets say, I want to move it to y = -2. If I use an iTween MoveTo and put the Vector3 as 0,-2,0, the object moves to x = 0 too. If I use Move Towards, I can set the target position, but I need to put in the X textbox something like transform.position.x to leave the X position as it is. How this is done?

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

2 Replies

  • Sort: 
avatar image
0
Best Answer

Answer by DarkSlash · Dec 11, 2014 at 07:05 PM

I have to do 3 actions, like in programming, but using Playmaker actions:

0) Create a Vector3 variable

1) Get the position an store it in the Vector3

2) Add to that vector -2 with the action Add Vector3 XYZ

3) Do a Move To the Vector3 variable that we created

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 M-G-Production · Dec 05, 2014 at 10:12 PM

Hi DarkSlash!

When you say move to "0,-2,0", you set absolute values wich are relative to the scene "grid".

In your case, you must make it relative to the object!

So There it is in C#:

 transform.position = new Vector3(transform.position.x,transform.position.y - 2, transform.position.z);

Bests, Math

Comment
Add comment · Show 3 · 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 DarkSlash · Dec 05, 2014 at 10:36 PM 0
Share

Of course that is the correct way, but I want to put that in the Playmaker action panel :)

avatar image DarkSlash · Dec 05, 2014 at 10:36 PM 0
Share

And I want to move the object to y = -2, not to transform.position. y - 2; )

avatar image M-G-Production · Dec 05, 2014 at 11:00 PM 0
Share

I'm sorry, I did not know about Playmaker visual scripting,

If you want Y to be absolute -2, I'm pretty sure you know how!

(ok ok... transform.position = new Vector3(transform.position.x,-2, transform.position.z); )

I can't help you more with Playmaker... But anyway, I tried to help!

Follow this Question

Answers Answers and Comments

26 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

Related Questions

How to make vehicles move in forward AND reverse using a touch to move system 0 Answers

MoveTowards inside Coroutine 2 Answers

Smooth motion physics Playmaker 0 Answers

how to stop something from following in the y axis 1 Answer

Move Object Using iTween 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