Wormholes #4982
Replies: 4 comments 4 replies
-
How does this differ from just adding a new Node2D/3D or RemoteTransform2D/3D? |
Beta Was this translation helpful? Give feedback.
-
Godot Engine is kinda not build like that. You have basic nodes that can be easly tweeked with a little bit of programming. Going that route we would need nodes for every possible game feature. You can easly achieve wormhole effect with 1-2 nodes and few lines of code. |
Beta Was this translation helpful? Give feedback.
-
Even if it is super easy to implement, a cheap built-in teleporting capability for rigids in the server could be nice to have. Something like (the defunct) Nape Physics' "portal", which also affect the scale of the shapes |
Beta Was this translation helpful? Give feedback.
-
Here's how to transform the player to the relative position, velocity and rotation of another teleporter. I originally put it together in Unity based on a video and a comment I found buried on Unity Answers and converted a few months ago to GDScript: func teleport(body):
var transform_it = transform.xform_inv(body.transform.origin)
var transform_point = other_tele.to_global(transform_it)
body.transform.origin = transform_point
var rotation = Quat(global_transform.basis).inverse()
var player_rotation = Quat(body.global_transform.basis)
var other_rotation = Quat(other_tele.global_transform.basis)
body.global_transform.basis = Basis(rotation * player_rotation * other_rotation)
body.velocity = other_tele.transform.basis.xform(transform.basis.xform_inv(body.velocity)) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I believe it would be beneficial to the Godot community to add a "wormhole" node
wormhole nodes would allow physics objects (Kinematic bodies and rigid bodies for example) to be teleported to a new area of the same scene (or if possible to a new scene) wormhole's shape could be any of the 3D or 2D primitives. i think this would benefit not only people making "portal clones" but anyone who wants to utilize Non-euclidean geometry such as those who want a building to have a small footprint but still be usable on the inside. wormholes would preserve the body's direction and velocity (an object that enters a wormhole pointed south (body going north at 1m/s) that is linked to a wormhole pointed north would exit the wormhole going south at 1 m/s) wormholes could be customly textured with a "wormhole texture" object (which would link to another wormhole node) and would display that which would be visible from the other side. while this can be implemented now in Godot implementations are often buggy, unreliable, and difficult to implement for the average user (this thought is based off of YouTube videos of people trying to implement this feature that I've seen).
Edit: (an object that enters a wormhole pointed south (body going north at 1m/s) that is linked to a wormhole pointed north would exit the wormhole going NORTH at 1 m/s not south) likewise (an object that enters a wormhole pointed south (body going north at 1m/s) that is linked to a wormhole pointed east would exit the wormhole going east at 1 m/s)
Beta Was this translation helpful? Give feedback.
All reactions