keremikzz
(keremikzz)
August 24, 2024, 10:10pm
1
I want to write a logic to spawn spheres on a locked x position but because i calculate the location by adding the direction, it distorts on the edges so the objects spawn on the edges are closer to camera.
1 Like
Everynone
(Everynone)
August 25, 2024, 8:30am
2
Yup, you’re tracing on the inside of a sphere who centre is at the camera location.
You’ll need Line Plane Intersection
:
You’re tracing with a fixed distance of 500, replacing the projection’s X with a fixed value. It’s actually hard to imagine how that would look like, a strangely distorted / twisted undulating surface mayhaps? , for sure.
I want this trace to stay on the same plane as my character, so the X value of the start point & end point should be the same.
Consider the following:
[image]
create a virtual plane where the character is and point it towards X (Plane Normal 1,0,0) …
Here’s some script allowing for picking up stuff and moving it in a specific plane only we determine ourselves manually:
[image]
The green debug plane visualises what’s going on. In short: shoot a beam (trace) from the screen centre towards the projected mouse cursor, when it eventually intersects that plane (which is infinitely large), place the actor at the intersect world coordinate.
If I change the normal:
[image]
You could derive this Normal from the actor itself instead:
[imag…