Jump to content

Trying to work out a good way to stop my "portal bouncing" issue.


Arphahat

Recommended Posts

I am making a portal that behaves similarly to the existing nether portals.  When I teleport the player into the other dimension, it places them in an existing or new portal.  Either way, the interaction with the portal blocks immediately triggers another teleport back to the overworld, and then back to the nether, etc.

 

I put in a countdown, but it only gets updated when the player is standing in the portal blocks, and is a cumbersome workaround.  What I'd really like is a way to flag the player as already being teleported until they leave and re-enter the portal, but am struggling with this.  I was thinking an event might work, but am not familiar with them and am not sure which one, if any, would help here.

 

Any input is appreciated.

 

Also, as an aside, I am also trying to duplicate the "wavy effect" that comes with standing in the portal after arriving in the other dimension, but am having difficulty tracking down where that happens or what triggers it.  Any help with this is also appreciated.

Link to comment
Share on other sites

In my stargate mod, rather than triggering teleportation when the player stands in a particular place, I detect when he passes through a plane at the centre of the portal. If the player's posX, posY, posZ is on one side of the plane, and his prevPosX, prevPosY, prevPosZ is on the other side, then teleportation occurs.

 

I do it this way because I want the player to be able to just walk straight through the portal without stopping. It seems to work very well, and I've never had any problems with bouncing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.