Forum Jump :

Author Message


Posts: 18
Rank:


Level: Member

Country: fr
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2020-06-29 02:22        
     
Hello,
I'm having a hard time figuring this out, fiddling with an ufo script.
Basically I created an ufo texture divided in 16 pieces, each showing ingame on a respective "UserTexture10m_F".

(I'm aware that there's a bunch of vehicle addons but I don't want to rely on these. I also tried to attach a bunch of submarines in circle but it ended up nor looking good, nor fps friendly...)

So I have made a 5 texture variants to mimic ufo pitch, when reaching defined distances, it swaps the textures of each pannels.
These 16 "UserTexture10m_F" vehicles are attached to a basic can that is attached to a heli flying 2km above.
Looking good so far, problem is the texture is only showing on one face, distorting it before it disapears when passing by.

Now I'd want this whole 40m custom texture pannel to always face the player.
Unfortunately when I try to apply setVectorDirAndUp to that can, the whole ufo's texture setup is doing a constant 360flip.

_vectorDirAndUp = [ufoCenter, player, false] call BIS_fnc_vectorDirAndUpRelative;
ufoCenter setVectorDirAndUp _vectorDirAndUp;

Same goes if I only apply setDir.
_relDir = ufoCenter getRelDir player;
ufoCenter setDir _relDir;

This is basically what I get : spinning-coin.gif

Thanks in advance for any assistance.

Edit : So, I've digged some more but didn't felt doing core math would do good with my brain. Thankfully I came across MrSanchez helmet lamp mod that is (I think) aiming me towards the right spot, as I was also stumbling with pitching a custom flashlight up or down it's still kind of related and though of pasting it here aswell. I'll update as soon as I get the main subject working (if I ever do).


Edit 2 : I came across a snippet by reddit user Commy2, tho I can't figure how to get it to work properly. Those vectors are driving me nuts. Almost there I think, at least my ufo stopped spinning & follows given target but there's an offset growing as the target gets further away :/


This post was edited by BurnToAshes (2020-07-13 01:39, 142 days ago)