• 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
5
Question by CracksisT · Feb 24, 2010 at 10:28 PM · collisionphysicscharacterplatformmove-with-moving-platform

How to get a Character to move with a moving platform ?

I've been trying to get my character to move along with my moving platform (like when i jump unto the platform it carries me long with it), but so far have been unable to do so.
I have a character with CharacterController, it has also been tagged by 'Player'.
My moving platform has a 'Rigidbody' attached to it, a 'Configurable Joint'and a 'Box Collider'. The platform is tagged with 'JumpPad5'.
This is the script attached to my moving platform:

var targetA : GameObject;
var targetB : GameObject;

var speed : float = 0.1;

function FixedUpdate ()
{
var weight = Mathf.Cos(Time.time speed 2 Mathf.PI) 0.5 + 0.5; transform.position = targetA.transform.position weight + targetB.transform.position (1-weight);
}

So if anyone can help me, pleaso do.

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

6 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Sebas · Feb 24, 2010 at 10:31 PM

There are already multiple answers for this question on the site. Please use the search option for next time. These Answers should get you started. If questions remain after reading those, feel free to post them.

Answer1

Answer2

Answer3

Comment
Add comment · Show 7 · 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 CracksisT · Feb 24, 2010 at 10:38 PM 0
Share

I already checked those answers and I couldn't get it working with my character. That's why I asked the question myself, providing my own information, hoping that would help.

avatar image Sebas · Feb 24, 2010 at 11:08 PM 0
Share

Not sure which option would be best, but I'd try to implement those other solutions first and ask questions in those answers via comments. What exactly didn't work when you tried those solutions? There are multiple answers provided, so it's not very likely that somebody is going to take the time and come up with something totally new here. Was the joint a problem? Try to break your platform/project down so you can get it to work with one of the provided solutions and so that you understand how they got it working, then expand to suit your needs. But that's just a thought.

avatar image CracksisT · Apr 03, 2010 at 06:35 PM 0
Share

When I use 'Answer1' I get an error saying: Assets/CharStickPlatform.js(26,44): BCE0020: An instance of type 'FPSWalker' is required to access non static member 'speed'. How do I solve this?

avatar image Sebas · Apr 04, 2010 at 12:02 AM 0
Share

Do you use the Character Controller with the FPSWalker script? The script for Answer1 requires you to use the FPSWalker script, because it refers to its variable speed.

avatar image CracksisT · Apr 17, 2010 at 05:17 PM 0
Share

No I probably didn't cause I don't know how to do this. (But I'm not trying to make a FPS, I'm trying to make a 3rd person game.)

Show more comments
  • ‹
  • 1
  • 2

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

23 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

Related Questions

How to stop first person player from walking through animated door 1 Answer

early collision above character controller 2 Answers

How can i make particles push back the player on collision? 1 Answer

gameobject destroyed on collision with character 3 Answers

Two Basic Physic Questions (Gravity and Jumping) 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