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 rbdavis · Jan 14, 2012 at 05:14 PM · velocityfirst person controllerplatformscharacter motor

Moving the floor flings First Person Controller 1000m backwards

I have a First Person Controller advancing along a floor. When I get to a certain point I want to move the entire floor and the FPC backwards to a different location.

If I have Moving Platform enabled, the FPC is flung about 1000m backwards when I do this (it took me a while to work out that this bizarre thing was happening!). If I disable Moving Platform it is OK but when I re-enable Moving Platform, the FPC is then flung.

I'm wanting to use moving platforms in the game so don't want to permanently disable it. I've tried the following to no avail:

1) switching MP off and on again (the FPC is flung immediately)

 _playerTransform.GetComponent(CharacterMotor).movingPlatform.enabled = true;

2) switching MP off and on after a delay (the FPC is flung when I switch back on)

3) setting platformVelocity to zero (no effect)

 _playerTransform.GetComponent(CharacterMotor).movingPlatform.platformVelocity = Vector3(0,0,0);

4) setting character motor velocity to zero (no effect)

 _playerTransform.GetComponent(CharacterMotor).movement.velocity = Vector3(0,0,0);

5) setting character motor frame velocity to zero (no effect)

 _playerTransform.GetComponent(CharacterMotor).movement.frameVelocity = Vector3(0,0,0);

Can anyone suggest how I do this simple thing - just moving the character and floor to a different location without anything getting flung across the scene.

Thanks!

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

· Add your reply
  • Sort: 
avatar image
0

Answer by icywater · Jan 14, 2012 at 05:20 PM

Try this http://answers.unity3d.com/questions/18155/moving-platform.html

Comment
Add comment · Show 4 · 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 rbdavis · Jan 14, 2012 at 05:33 PM 0
Share

I already read this thread but it doesn't really answer how to stop the unwanted movement. There must be a variable that is being stored and that I need to set to prevent the flinging effect.

avatar image rbdavis · Jan 14, 2012 at 05:39 PM 0
Share

$$anonymous$$y problem isn't the FPC slipping or falling through a platform. It's platform velocity being transferred to the FPC to fling it backwards.

avatar image icywater · Jan 14, 2012 at 09:01 PM 0
Share

It should be the same. Have you tried the 2D Platfor$$anonymous$$g tut?

avatar image rbdavis · Jan 17, 2012 at 01:21 AM 0
Share

I'll re-read it.

avatar image
0

Answer by aldonaletto · Jan 15, 2012 at 02:04 PM

You could try a transparent trigger a little larger than the moving area (and childed to it), and turn MovingPlatform.enabled off in OnTriggerEnter, and on again in OnTriggerExit:

function OnTriggerEnter(other: Collider){ if (other.tag == "Player"){ other.GetComponent(CharacterMotor).movingPlatform.enabled = false; } }

function OnTriggerEnter(other: Collider){ if (other.tag == "Player"){ other.GetComponent(CharacterMotor).movingPlatform.enabled = true; } }

Comment
Add comment · Show 2 · 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 aldonaletto · Jan 15, 2012 at 04:36 PM 1
Share

How are you moving the platform? I just teleported it to a position 20 units behind in z, and the player followed it without any problem:

 transform.position.z -= 20;

I had problems only when the platform was moving and its velocity changed too much - the player was thrown to a long distance in some cases.

avatar image rbdavis · Jan 17, 2012 at 01:23 AM 0
Share

I am indeed "teleporting" the platform not animating it. Strange I don't get the same result. $$anonymous$$y player is moving at the time of teleport, but the platform is never animated to move.

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

6 People are following this question.

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

Related Questions

Is there a way to set or entirely cancel the velocity of a character controller? 1 Answer

Velocity powered rigidbody on a moving platform without parenting. 3 Answers

Way to set first person controller velocity? 1 Answer

My controls become inverted after a few seconds in runtime 1 Answer

Calculate player velocity change while taking into account velocity of what the player is standing on 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