I tried, and I searched, but I could not find any reliable c# example for a simple projectile that launches from from one point, aka, a gun barrel, and launches. I've found several GD scripts, but attempting to translate them to c# ended in failure since GD script seems to have a lot of short cuts. Like say. being able to call the node's transformer and tell it where to spawn. I was using the godot-3d-mannequin sample project as a base. https://github.com/GDquest/godot-3d-mannequin .

These are my main problems. How do you set the starting position of a node in c#. IE, make a bullet spawn on mouse press. -Most important. How do you remove a child node from a parent, but not delete it. -Also importnat. How do I make it actually travel, not hitscan. -Optional How do I do hitscan? -Optional

Well I 'managed to solve most of my problems. I now have a traveling bullet, I cheated by using the GD bullet script from the FPS tutorial. When I tried to convert it to c#, the bullets just stay floating in place.

extends Spatial


var BULLET_SPEED = 70

var BULLET_DAMAGE = 15






const KILL_TIMER = 4
var timer = 0




var hit_something = false

func _ready():
	
	
	$Area.connect("body_entered", self, "collided")
	

func _physics_process(delta):
	
	
	var forward_dir = global_transform.basis.z.normalized()
	global_translate(forward_dir * BULLET_SPEED * delta)
	
	
	timer += delta
	if timer >= KILL_TIMER:
		queue_free()


func collided(body):
	
	
	if hit_something == false:
		if body.has_method("bullet_hit"):
			body.bullet_hit(BULLET_DAMAGE, global_transform)
	
	
	hit_something = true
	queue_free()
VS

using System;
using Godot;
using Dictionary = Godot.Collections.Dictionary;
using Array = Godot.Collections.Array;


public class BulletScript : Spatial
{
	 
	// The speed the bullet travels at
	public int BULLET_SPEED = 70;
	// The damage the bullet does on whatever it hits
	public int BULLET_DAMAGE = 15;
	// NOTE: for both BULLET_SPEED && BULLET_DAMAGE, we are keeping their
	// names uppercase because we do !want their values to change outside of
	// when they are instanced/spawned.
	
	// The length of time this bullet last (in seconds) before we free it.
	// (because we do !want the bullet to travel forever, as it will consume resources)
	public const int KILL_TIMER = 4;
	public float timer = 0;
	
	// A boolean to store whether || !we have hit something.
	// This is so we cannot damage more than one object if we manage to hit more than one before
	// this bullet is set free / destroyed
	public bool hit_something = false;
	
	public void _ready()
	{  
		// We want to get the area && connect ourself to it's body_entered signal.
		// This is so we can tell when we've collided with an object.
		GetNode("Area").Connect("body_entered", this, "collided");
	}
	
	public void _physics_process(float delta)
	{  
		// Get the forward directional vector && move ourself by it (times BULLET_SPEED && delta)
		// NOTE: This is the bullet's local positive Z axis.
		var forward_dir = GlobalTransform.basis.z.Normalized();
		//GlobalTransform(forward_dir * BULLET_SPEED * delta);
		GlobalTranslate(forward_dir * BULLET_SPEED * delta);
		
		// A simple timer check that frees this node when the timer is done.
		timer += delta;
		if(timer >= KILL_TIMER)
		{
			QueueFree();
		}
	}
	
	public void collided(Node body)
	{  
		// If we have !hit something already check if the body we collided with has the 'bullet_hit' method.
		// If it does, then call it, passing our global origin as the bullet collision point.
		if(hit_something == false)
		{
			if(body.HasMethod("bullet_hit"))
			{
				//THIS DOES NOT WORK IN C#, WHAT IS THE ALTERNATIVE?
				//body.bullet_hit(BULLET_DAMAGE, GlobalTransform);		
		// Set hit_something to true because we've hit an object && set free ourself.
			}
		}
		hit_something = true;
		QueueFree();
	}
}

I just noticed, I forgot to make the c# functions public override void Ready(float delta) public override void PhysicsProcess(float delta)

instead of public void ready() public void physics_process(float delta)

2 years later