This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

How do I properly use AimVector?

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
pillers
Meatbag
Posts: 7
Joined: Sun Dec 02, 2018 10:11 am
Title: Deluxe Superfighter
Age: 27

How do I properly use AimVector?

Post by pillers » Thu Jan 24, 2019 2:24 am

I'm trying to spawn a projectile with the direction of the players AimVector like this.

Code: Select all

Game.SpawnProjectile(ProjectileItem.REVOLVER, this.ply.GetWorldPosition, this.ply.AimVector);
But this line of code gives me an error message that reads.
CS1503 Argument 2: cannot convert from 'method group' to 'SFDGameScriptInterface.Vector2'
What exactly am I doing wrong and how do I fix it?
0 x

Code: Select all

while true

User avatar
Sree
Superfighter
Superfighter
Posts: 325
Joined: Sun May 08, 2016 8:19 pm
SFD Account: phasmic
SFD Alias: sree
Gender:
Age: 25

Post by Sree » Thu Jan 24, 2019 8:29 am

You forgot the parenthesis after GetWorldPosition, that is the reason for the error.
1 x

Locked