S2ENGINE HD  1.4.6
Official manual about S2Engine HD editor and programming
Projectile

Base Class: SceneObject

Projectile.jpg

Overview

Projectile is a special kind of object used, mainly, to check if something is hitted when a character weapon shoot. When it hits a surface of an object it sends a message to the hitted object, so, using script, you can code the response of the object to the hit. In other words projectile executes at every frame the RayPick operation during its travel.

Parameters
Speed(float) Speed of the projectile.
Power(float) Damaging power of the projectile when it hits an object.
defaultPS(string) Default particle system prefab that has to be spawned when projectile hits a surface.
DefaultDecal(string) Default decal prefab that has to be spawned when projectile hits a surface.
impactPSs(string) List of particle system prefabs to spawn for every material archetype. See Material properties.
impactDecals(string) List of decal prefabs to spawn for every material archetype. See Material properties.
Note
If an impactPS or an impactDecal is not specified for a given archetype material default contactPS and contactDecal of the hit material (See Material properties) are spawned if exist, if not defaultPS and DefaultDecal are spawned if exist.

Receiving Messages

none

Sending Messages

Name Description Content parameters Receivers
Hitted This message is Sent every time projectile hits an object
  • message#0: power
  • message#1: normal of contact (pick Normal)
  • message#2: point of contact (pickPos)
  • message#3: name of hitted node (pickNode), needed to know what node object has been hitted if the hitted entity is a hierarchy of more that one object.
  • message#4: vector direction of the projectile, expressed as tree float separated by a ',' simbol
  • message#5: speed of the projectile multiplied for 100000, often used as force length param in PhysicsApplyForce
Hit Object

See also
Messages