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 Schytheron · Sep 06, 2015 at 12:38 PM · rigidbodycharactercontrollervelocitycharacter controllerportal

How does the premade FPSController handle character physics?

Hi, Im making a Portal-like game in Unity and I decided to use the premade Unity FPSController prefab for my character. I made a script that changes the rigidbody velocity of the object that passes thru one of the portals. The script works fine when using a normal object (I pushed a sphere with a rigidbody thru one of the portals and the ball thru out of the second portal with a correct velocity), but when my character passes thru one of the portals he becomes completely unaffected by the velocity change.

I noticed that the character uses both a character controller and a rigidbody(I have no idea how character controllers work). Does that have something to do with it? Why is my character prefab unaffected? Does anyone here have anymore insight on how the FPS prefab works or atleast how a character controller works? Thanks! (Im a Unity noob)

Comment
Add comment · Show 2
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 Eudaimonium · Sep 06, 2015 at 10:11 PM 0
Share

Without seeing some code, it's hard to tell.

I don't even know what do you mean by "velocity change". Is this basically preserving the player's momentum through the portals?

Basically you'd need to save the velocity of the inco$$anonymous$$g object into the portal, and apply that velocity to both instances of the object (one on one side, and one on the other side of the portal), to the best of my knowledge of portal mechanics.

Out of curiosity, what kind of approach are you taking to solving the portals problem? I myself had interest in doing a portal mechanics clone, which means both precise rendering of image through the portal AND seamless transitions. Googling around reveals that pretty much no-one actually accurately solved this, due to a deceptively large amount of work involved, both in physics department (cloning of objects that are inside portal's entry areas and duplicating controls and physics between them), and especially graphics (re-rendering of the scene from accurate angle to render texture, AND applying stencil rendering for solving the near-plane camera to portal clipping). It's basically the ultimate challenge.

avatar image Schytheron · Sep 07, 2015 at 06:14 PM 0
Share

@Eudaimonium Im not that interested in the portals visual parts. Im more concerned about the portal physics. $$anonymous$$y code looks abit like this: otherRigidBody.velocity = otherPortal.transfrom.forward * otherRigidbody.velocity.magnitude

(other = the object that has gone thru the portal) I basically want the rigidbody to keep its velocity but change direction to the direction the portal is facing. This works with all objects except for my FPSController prefab character and I dont know why!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by kel12 · Oct 26, 2021 at 04:42 AM

hey man, im trying the same thing maybe check out this thread https://answers.unity.com/questions/1614287/teleporting-character-issue-with-transformposition.html I fixed the issue by going to Edit > Project Settings > Physics and turning on Auto Sync Transforms

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Character Controller velocity match separate forward/backwards and left/right move speeds? 0 Answers

Best Strategy to interact with rigidbody 2 Answers

My player is stuck on left and right side(Endless Runner) 0 Answers

How to tell if the player is turning? 2 Answers

Help With Charchter Controller or Rigidbody . Please! 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