How to make a raycast start position change

Hello!
I was wondering about how do you make a raycast’s start location change by a value. I have my raycast currently setup with the start position being the actors start position. Would I have to add on values to make the start location move? I am trying to make the raycast move a predefined amount to the left or right depending on which bullet the player is on (I have an ammo system already in place, and the branch is working, I am just wondering how to make it move to a predefined location each time the player fires).
Cheers!

Just add some value to the player position before feeding it to your start position.

If you want to move it relative to the player position you have to get “Forward Vector”, “Up Vector” or “Right Vector” and multiply it by however far you want it to be deplaced.

Those three vectors are all exactly one unit long which means multiplying the vector with 100 gives you a vector with the length of 100.

Cheers

Thank you, but my current system has no up vector or right vector, instead just the forward vector is the starting position, how would I make that move to the side or up and down? Just multiply it, or do I need to get the up vectors and forward vector for this to work?

That is my current start position script, what would I multiply or add to make it change the start position?

The start position of the trace?

Whatever you want. It’s just a vector. You can do whatever you want with it.

I honestly don’t know what exactly you are asking.

coordinates are your xy(z), if you change any of them you change your position, z being the altitude. So it all depends on where you want the vector position to end up. I would get a fresh vector of the end location and interpolate to that, unless you’re doing something like a non-linear trajectory trace, in which case you would want to offset your starting position by a small amount each step, is that what you are trying to do? here is a small example I use for tracing my jump trajectory, unfortunately you have to take all your variable changes into account, so if you mess with speed (of the bullet?) later on, or with friction, it won’t be precise.

How would I make the linetrace start position move up or to the side with this current BP.

Are you familiar with vector math? Even just the basics?

Yes, what I meant was how could I make the linetrace move whenever a variable is at a certain number, not the vector BP’s.

You can just add a certain number to your vector via a simple add node.

Just search for + in the context menu and it’ll show up.

Or select whether or not it should be modified by adding a “Select” node right after, one getting the modified result, one getting the original one.

You can do pretty much everything you want with the vector itself. I’m just having trouble understanding what exactly you need. Move the line trace start position.

Easy. Vector → + → Enter the value you want to move it by in the fields for the second array. Done. You can do the same with multiplying either each value by another one or all with the same value (vector * float).

You have a base grid. Your world. Everything you place in the level, every blueprint you spawn will be placed relatively to your level. The vector resembles the path from the origin of the level to your actor since all vectors have a direction. You can then on top of that location add whatever you want by simply adding other vectors ontop of it, move it around by changing the values and so on.

Right now I really can’t get a picture of what exactly your problem is.

I have already tried adding my actor vector to another vector, and it did not work.

I got it to work!
I added the actor vector with a float and used a branch to determine which value would be chosen.
Thank you for the help!