Closed Akulation closed 1 year ago
All of my plugins with raycast works fine
okay, to update on this, the barricades/structures are working for raycast. the vehicles and players are not working though.
What exactly code fails?
This is how I use raycasts in my plugins
var aim = sp.player.look.aim;
if (Physics.Raycast(aim.position, aim.forward, out var hit, cfg.Distance, RayMasks.DAMAGE_PHYSICS))
{
var col = hit.collider;
if (col != null)
{
var t = col.transform;
if (col.CompareTag("Structure"))
{
t = DamageTool.getStructureRootTransform(t);
var drop = StructureManager.FindStructureByRootTransform(t);
if (drop != null)
{
}
}
else if (col.CompareTag("Barricade"))
{
t = DamageTool.getBarricadeRootTransform(t);
var drop = BarricadeManager.FindBarricadeByRootTransform(t);
if (drop != null)
{
}
}
else if (col.CompareTag("Vehicle"))
{
var vehicle = DamageTool.getVehicle(t);
if (vehicle != null)
{
}
}
}
}
im not sure, i dont make my own plugins for rocketmod. the plugins are used by many people and seem to work for everyone, i was told by the plugin developer to ask here for help.
In my server any command/event/whatever that uses the function of a player looking at a barricade/player/vehicle stopped working. This is for a couple of rocketmod plugins aswell as uscripts.
The main one that is happening is for a plugin that allows players to revive another player by using surrender and looking at the knocked down player.