Originally Posted By: DriftWood
I see. Well great enjoy your hobby.
It's impossible for *"Nothing changed" to change. It is possible that the change was too small. After all we moved the vecTarget so something change. So let's assume the change is just too small. Than try this.
Code:
vec_set( vecTarget, hit.x);
vec_set ( vec_temp, hit.nx);
vec_normalize ( vec_temp, 555);// Huge change
vec_add ( vecTarget, vec_temp);



If you still see no change something else is happening.
If you see a big change, than adjust 555 down until close to correct.

I also don't understand this lerp
Code:
vec_lerp ( camera.x, camera.x, vecTarget, time_step );]


The value of Time_step is a small decimal. It's not collecting or adding to anything or itself. This could be a your big problem.

Try

Code:
..............
var range = 0;
.............

if(Taget_hit)
{
.........
if (range < 1)
range += time_step;
}
else
{
.....
range = 0;
}

vec_lerp ( camera.x, camera.x, vecTarget, range );]



I would like you to understand, I don't use this engine, I haven't in over a year. I don't have this engine installed and I work from memory, logic and looking in the manual to answer your questions. Finally I get nothing out of helping you, I answer for your benefit, my involvement is volunteer and I can stop if it's not to you're taste.

We all have jobs or other things to take our time. I currently am working on a project in another community and also learning a second engine, so my free time has other things to fill it than answering here.

I apologize. I really do sincerely appreciate your help.

I am realizing that your code actually does work. I am just seeing blue on the right half of the camera before the HIT_TARGET is activated in the exact middle of the camera, and once it is activated, the camera is pushed inside the wall using your code, as it needs to do. So, thank you. Thanks to you, the code is working as it should after the HIT_TARGET is activated.

Now I am trying to make it so that the:

Code:
var distance = c_trace ( player.x, vecTarget, IGNORE_ME |
   IGNORE_PASSABLE | IGNORE_SPRITES | USE_POLYGON );


...before the HIT_TARGET call makes collision on the right side of the camera, instead of its dead center. It seems to me that collision is happening only in the middle of the camera, instead of the actual side of the camera, making it so that the camera's right half peeks past the wall, until the wall hits center on the camera lens, then collision happens, and activates your code. I am trying to figure out how to make collision happen on the right side of the camera, so that I do not have to see the blue at all when turning the player's back toward the wall.

I will try to use your logic before the HIT_TARGET call to make the same thing happen before that call, as it does after.

Last edited by Ruben; 02/21/18 04:15.