Jimin Park 24 Posted May 2, 2020 Let's say a player is facing a certain direction. I need vector position that is exactly 7 distance away from the player to a position it is facing. How could this be obtained in Visual Scripting? 1 Share this post Link to post Share on other sites
Jimin Park 24 Posted May 3, 2020 (edited) For those of you who are wondering how, I found an OK solution for this for the current version of Ylands. What I ended up doing was I created Reference Point game logic and set it animated. Make this Reference Point game logic follow the player with offset 0, 0, 7 (Z value here can be any distance away from the character you want Whenever you need to find a point that is infront of the character, you can use the position of that Reference Point that is following the character constantly at the front of the character. As you can see this is a bit of a hack but it works. If anybody knows a better way to do this please let me know. Edited May 3, 2020 by Jimin Park Share this post Link to post Share on other sites
Azazil00 13 Posted June 29, 2020 There is a better way than using the reference point. It's what I use to make some magic weapons and things. You'll need to be able to reference the player in the visual script, so you'll need to be able to get your characters position and rotation. all you need to do is copy the Position tab in this picture. The picture is basically an example of a particle effect playing in front of the caster at a set distance and height. it is basically getting the position of your player and adding a set value for distance and height in the direction you're facing. I the VECTOR tab, X and Z are what is getting your rotation. The Y value is how high off the ground you want your point to be. The last number in the Position tab is how far you want your point to be in front or (if negative) behind your character. Extra Explanation: in the VECTOR tab X and Z are getting the Sin and Cos of the Y value of your character's rotation. The Y value of your character's rotation is the degree at which your character is rotated. When you plug the Sin in the X spot and the Cos in the Z spot, they cancel out to give you the direction you're facing. There is another post in these forums that explains that better, something about throwing a ball or something. 1 Share this post Link to post Share on other sites
Houp 237 Posted July 20, 2020 Hi, another option is to use "Transfrom position" script tile. 1 Share this post Link to post Share on other sites
Igor Q. 519 Posted July 20, 2020 1 hour ago, Houp said: Hi, another option is to use "Transfrom position" script tile. @Jimin Park Keep in mind something. (This is particularly useful to animations) Set/Get Position will always be relative to the world coordinates. Transform Position will always be relative to the local object/entity. Share this post Link to post Share on other sites